@@ -87,6 +87,8 @@ module.exports = function (log, config, bounces) {
8787 postAddRecoveryPhone : 'recovery-phone-added' ,
8888 postChangeRecoveryPhone : 'recovery-phone-changed' ,
8989 postRemoveRecoveryPhone : 'recovery-phone-removed' ,
90+ postSigninRecoveryPhone : 'signin-recovery-phone' ,
91+ postSigninRecoveryCode : 'signin-recovery-code' ,
9092 recovery : 'forgot-password' ,
9193 unblockCode : 'new-unblock' ,
9294 verify : 'welcome' ,
@@ -140,6 +142,8 @@ module.exports = function (log, config, bounces) {
140142 postChangeAccountRecovery : 'manage-account' ,
141143 postRemoveAccountRecovery : 'manage-account' ,
142144 postAddRecoveryPhone : 'manage-account' ,
145+ postSigninRecoveryPhone : 'manage-account' ,
146+ postSigninRecoveryCode : 'manage-account' ,
143147 recovery : 'reset-password' ,
144148 unblockCode : 'unblock-code' ,
145149 verify : 'activate' ,
@@ -1584,19 +1588,14 @@ module.exports = function (log, config, bounces) {
15841588
15851589 Mailer . prototype . postAddRecoveryPhoneEmail = function ( message ) {
15861590 const templateName = 'postAddRecoveryPhone' ;
1587- const links = this . _generateLinks (
1588- this . initiatePasswordResetUrl ,
1589- message ,
1590- { } ,
1591- templateName
1592- ) ;
1591+ const links = this . _generateSettingLinks ( message , templateName ) ;
15931592 const [ time , date ] = this . _constructLocalTimeString (
15941593 message . timeZone ,
15951594 message . acceptLanguage
15961595 ) ;
15971596
15981597 const headers = {
1599- 'X-Link' : links . resetLink ,
1598+ 'X-Link' : links . link ,
16001599 } ;
16011600
16021601 return this . send ( {
@@ -1676,7 +1675,7 @@ module.exports = function (log, config, bounces) {
16761675 ) ;
16771676
16781677 const headers = {
1679- 'X-Link' : links . resetLink ,
1678+ 'X-Link' : links . link ,
16801679 } ;
16811680
16821681 return this . send ( {
@@ -1696,6 +1695,66 @@ module.exports = function (log, config, bounces) {
16961695 } ) ;
16971696 } ;
16981697
1698+ Mailer . prototype . postSigninRecoveryPhoneEmail = function ( message ) {
1699+ const templateName = 'postSigninRecoveryPhone' ;
1700+ const links = this . _generateSettingLinks ( message , templateName ) ;
1701+ const [ time , date ] = this . _constructLocalTimeString (
1702+ message . timeZone ,
1703+ message . acceptLanguage
1704+ ) ;
1705+
1706+ const headers = {
1707+ 'X-Link' : links . link ,
1708+ } ;
1709+
1710+ return this . send ( {
1711+ ...message ,
1712+ headers,
1713+ template : templateName ,
1714+ templateValues : {
1715+ date,
1716+ device : this . _formatUserAgentInfo ( message ) ,
1717+ privacyUrl : links . privacyUrl ,
1718+ link : links . link ,
1719+ resetLink : links . resetLink ,
1720+ resetLinkAttributes : links . resetLinkAttributes ,
1721+ supportLinkAttributes : links . supportLinkAttributes ,
1722+ supportUrl : links . supportUrl ,
1723+ time,
1724+ } ,
1725+ } ) ;
1726+ } ;
1727+
1728+ Mailer . prototype . postSigninRecoveryCodeEmail = function ( message ) {
1729+ const templateName = 'postSigninRecoveryCode' ;
1730+ const links = this . _generateSettingLinks ( message , templateName ) ;
1731+ const [ time , date ] = this . _constructLocalTimeString (
1732+ message . timeZone ,
1733+ message . acceptLanguage
1734+ ) ;
1735+
1736+ const headers = {
1737+ 'X-Link' : links . link ,
1738+ } ;
1739+
1740+ return this . send ( {
1741+ ...message ,
1742+ headers,
1743+ template : templateName ,
1744+ templateValues : {
1745+ date,
1746+ device : this . _formatUserAgentInfo ( message ) ,
1747+ privacyUrl : links . privacyUrl ,
1748+ link : links . link ,
1749+ resetLink : links . resetLink ,
1750+ resetLinkAttributes : links . resetLinkAttributes ,
1751+ supportLinkAttributes : links . supportLinkAttributes ,
1752+ supportUrl : links . supportUrl ,
1753+ time,
1754+ } ,
1755+ } ) ;
1756+ } ;
1757+
16991758 Mailer . prototype . postAddAccountRecoveryEmail = function ( message ) {
17001759 log . trace ( 'mailer.postAddAccountRecoveryEmail' , {
17011760 email : message . email ,
0 commit comments