Skip to content

Commit

Permalink
feat(ras-acc): add faq section to otp email (#3034)
Browse files Browse the repository at this point in the history
This PR adds an FAQ section to the otp email template
  • Loading branch information
chickenn00dle authored Apr 18, 2024
1 parent 58424b9 commit bccb560
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 15 deletions.
11 changes: 11 additions & 0 deletions includes/class-magic-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ public static function send_email( $user, $redirect_to = '', $use_otp = true ) {
if ( \is_wp_error( $token_data ) ) {
return $token_data;
}

$key = \get_password_reset_key( $user );
if ( is_wp_error( $key ) ) {
return $key;
}

$url = \add_query_arg(
[
'action' => self::AUTH_ACTION,
Expand All @@ -427,6 +433,11 @@ public static function send_email( $user, $redirect_to = '', $use_otp = true ) {
'template' => '*MAGIC_LINK_URL*',
'value' => $url,
],
[
'template' => '*SET_PASSWORD_LINK*',
'value' => Emails::get_password_reset_url( $user, $key ),
],

];
if ( $use_otp && ! empty( $token_data['otp'] ) ) {
$email_type = 'OTP_AUTH';
Expand Down
4 changes: 4 additions & 0 deletions includes/reader-activation/class-reader-activation-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public static function add_email_configs( $configs ) {
'label' => __( 'the login link', 'newspack' ),
'template' => '*MAGIC_LINK_URL*',
],
[
'label' => __( 'the password reset link', 'newspack' ),
'template' => '*SET_PASSWORD_LINK*',
],
]
),
];
Expand Down
Loading

0 comments on commit bccb560

Please sign in to comment.