Skip to content

Commit 1e99248

Browse files
committed
adjust wording for step 3 failure
1 parent c0062e9 commit 1e99248

2 files changed

Lines changed: 50 additions & 21 deletions

File tree

assets/js/web-components/prpl-task-sending-email.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,17 @@ customElements.define(
237237
).style.display = 'flex';
238238
}
239239

240+
/**
241+
* Open the troubleshooting guide.
242+
*/
243+
openTroubleshootingGuide() {
244+
// Open the troubleshooting guide in a new tab.
245+
window.open( prplEmailSending.troubleshooting_guide_url, '_blank' );
246+
247+
// Close the popover.
248+
this.closePopover();
249+
}
250+
240251
/**
241252
* Popover closing, reset the layout, values, etc.
242253
*/

classes/suggested-tasks/providers/interactive/class-email-sending.php

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ class Email_Sending extends Interactive {
9191
*/
9292
protected $is_wp_mail_overridden = false;
9393

94+
/**
95+
* The troubleshooting guide URL.
96+
*
97+
* @var string
98+
*/
99+
protected $troubleshooting_guide_url = 'https://prpl.fyi/troubleshoot-smtp';
100+
94101
/**
95102
* Initialize the task provider.
96103
*
@@ -112,8 +119,8 @@ public function init() {
112119
\add_action( 'init', [ $this, 'check_if_wp_mail_has_override' ], PHP_INT_MAX );
113120

114121
$this->email_subject = \esc_html__( 'Your Progress Planner test message!', 'progress-planner' );
115-
// translators: %s the admin URL.
116-
$this->email_content = sprintf( \esc_html__( 'You just used Progress Planner to verify if sending email works on your website. The good news; it does! Click %s to mark Ravi\'s Recommendation as completed.', 'progress-planner' ), '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'here', 'progress-planner' ) . '</a>' );
122+
// translators: %1$s <br><br> tags, %2$s the admin URL.
123+
$this->email_content = sprintf( \esc_html__( 'You just used Progress Planner to verify if sending email works on your website. %1$s The good news; it does! Click %2$s to mark Ravi\'s Recommendation as completed.', 'progress-planner' ), '<br><br>', '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'here', 'progress-planner' ) . '</a>', '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'here', 'progress-planner' ) . '</a>' );
117124
}
118125

119126
/**
@@ -154,9 +161,10 @@ public function enqueue_scripts() {
154161
[
155162
'name' => 'prplEmailSending',
156163
'data' => [
157-
'ajax_url' => \admin_url( 'admin-ajax.php' ),
158-
'nonce' => \wp_create_nonce( 'progress_planner' ),
159-
'unknown_error' => \esc_html__( 'Unknown error', 'progress-planner' ),
164+
'ajax_url' => \admin_url( 'admin-ajax.php' ),
165+
'nonce' => \wp_create_nonce( 'progress_planner' ),
166+
'unknown_error' => \esc_html__( 'Unknown error', 'progress-planner' ),
167+
'troubleshooting_guide_url' => $this->troubleshooting_guide_url,
160168
],
161169
]
162170
);
@@ -319,7 +327,7 @@ public function the_popover_content() {
319327
printf(
320328
/* translators: %s is a link to the troubleshooting guide. */
321329
\esc_html__( 'There are a few common reasons why your email might not be sending. Check the %s to find out what’s causing the issue and how to fix it.', 'progress-planner' ),
322-
'<a href="https://prpl.fyi/troubleshoot-smtp" target="_blank">' . \esc_html__( 'troubleshooting guide', 'progress-planner' ) . '</a>'
330+
'<a href="' . \esc_url( $this->troubleshooting_guide_url ) . '" target="_blank">' . \esc_html__( 'troubleshooting guide', 'progress-planner' ) . '</a>'
323331
);
324332
?>
325333
</p>
@@ -411,25 +419,35 @@ public function the_popover_content() {
411419
<?php /* Email not received, showing troubleshooting */ ?>
412420
<div class="prpl-columns-wrapper-flex prpl-sending-email-step" id="prpl-sending-email-troubleshooting-step" style="display: none;">
413421
<div class="prpl-column prpl-column-content">
422+
<p>
423+
<?php
424+
\esc_html_e( 'We\'re sorry to hear you did not receive our confirmation email yet. On some websites, it make take up to a few hours to send email. That\'s why we strongly advise you to check back in a few hours from now.', 'progress-planner' );
425+
?>
426+
</p>
427+
<p>
428+
<?php
429+
\esc_html_e( 'If you already waited a couple of hours and you still didn\'t get our email, your email might not be working well. If you haven\'t already, you may need to install a plugin to handle email for you.', 'progress-planner' );
430+
?>
431+
</p>
414432
<?php if ( $this->is_there_sending_email_override() ) : ?>
415-
<p><?php \esc_html_e( 'Your website is using a plugin that filters emails.', 'progress-planner' ); ?></p>
433+
<p>
434+
<?php
435+
\esc_html_e( 'We\'ve detected you\'re most likely already running an SMTP plugin. Please check its documentation to help you in troubleshooting.', 'progress-planner' );
436+
?>
437+
</p>
416438
<?php else : ?>
417-
<p><?php \esc_html_e( 'Your website is not using a plugin that filters emails.', 'progress-planner' ); ?></p>
439+
<p>
440+
<?php
441+
printf(
442+
/* translators: %s is a link to the troubleshooting guide. */
443+
\esc_html__( 'We\'ve not detected an SMTP plugin on your site. Installing one may help resolving the email problem. You can read more about this at %s.', 'progress-planner' ),
444+
'<a href="' . \esc_url( $this->troubleshooting_guide_url ) . '" target="_blank">' . \esc_html__( 'troubleshooting guide', 'progress-planner' ) . '</a>'
445+
);
446+
?>
447+
</p>
418448
<?php endif; ?>
419-
</div>
420-
421-
<div class="prpl-column">
422-
<h2><?php \esc_html_e( 'Email Troubleshooting', 'progress-planner' ); ?></h2>
423-
<p><?php \esc_html_e( 'Here are some steps to fix email sending issues:', 'progress-planner' ); ?></p>
424-
<ul>
425-
<li><?php \esc_html_e( 'Check your SMTP settings are correct', 'progress-planner' ); ?></li>
426-
<li><?php \esc_html_e( 'Ensure your domain\'s SPF records are properly configured', 'progress-planner' ); ?></li>
427-
<li><?php \esc_html_e( 'Verify your email provider credentials', 'progress-planner' ); ?></li>
428-
<li><?php \esc_html_e( 'Try sending to a different email address', 'progress-planner' ); ?></li>
429-
</ul>
430-
431449
<div class="prpl-steps-nav-wrapper">
432-
<button class="prpl-button" data-action="closePopover"><?php \esc_html_e( 'Close', 'progress-planner' ); ?></button>
450+
<button class="prpl-button" data-action="openTroubleshootingGuide"><?php \esc_html_e( 'Take me to your troubleshooting guide', 'progress-planner' ); ?></button>
433451
</div>
434452
</div>
435453
</div>

0 commit comments

Comments
 (0)