Update First purchase automatic emails

Add "When to send this email" and "after first purchase" texts to the page

MAILPOET-4658
This commit is contained in:
Oluwaseun Olorunsola
2022-10-14 12:08:12 +01:00
committed by Aschepikov
parent 9a14ddb57c
commit 6cb5ceca21
4 changed files with 17 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ import { MailPoet } from 'mailpoet';
import { Selection } from 'form/fields/selection.jsx'; import { Selection } from 'form/fields/selection.jsx';
import { FormFieldText } from 'form/fields/text.jsx'; import { FormFieldText } from 'form/fields/text.jsx';
import { timeDelayValues } from 'newsletters/scheduling/common.jsx'; import { timeDelayValues } from 'newsletters/scheduling/common.jsx';
import { Grid } from 'common/grid';
const defaultAfterTimeType = 'immediate'; const defaultAfterTimeType = 'immediate';
const defaultAfterTimeNumber = 1; const defaultAfterTimeNumber = 1;
@@ -142,10 +143,15 @@ class EventScheduling extends Component {
const { event } = this.props; const { event } = this.props;
return ( return (
<> <>
<div className="mailpoet-grid-column mailpoet-flex"> <h4> {MailPoet.I18n.t('whenToSendMail')} </h4>
<Grid.CenteredRow className="mailpoet-re-engagement-scheduling">
{this.displayAfterTimeNumberField()} {this.displayAfterTimeNumberField()}
{this.displayAfterTimeTypeOptions()} {this.displayAfterTimeTypeOptions()}
</div>
{event.afterDelayText && <p>{event.afterDelayText}</p>}
</Grid.CenteredRow>
<div className="mailpoet-form-errors" /> <div className="mailpoet-form-errors" />
<div className="mailpoet-gap" /> <div className="mailpoet-gap" />
{event.schedulingReadMoreLink && ( {event.schedulingReadMoreLink && (
@@ -175,6 +181,7 @@ EventScheduling.propTypes = {
onValueChange: PropTypes.func, onValueChange: PropTypes.func,
event: PropTypes.shape({ event: PropTypes.shape({
defaultAfterTimeType: PropTypes.string, defaultAfterTimeType: PropTypes.string,
afterDelayText: PropTypes.string,
timeDelayValues: PropTypes.objectOf( timeDelayValues: PropTypes.objectOf(
PropTypes.shape({ PropTypes.shape({
text: PropTypes.string, text: PropTypes.string,

View File

@@ -55,25 +55,26 @@ class AbandonedCart {
'title' => _x('Abandoned Shopping Cart', 'This is the name of a type of automatic email for ecommerce. Those emails are sent automatically when a customer adds product to his shopping cart but never complete the checkout process.', 'mailpoet'), 'title' => _x('Abandoned Shopping Cart', 'This is the name of a type of automatic email for ecommerce. Those emails are sent automatically when a customer adds product to his shopping cart but never complete the checkout process.', 'mailpoet'),
'description' => __('Send an email to logged-in visitors who have items in their shopping carts but left your website without checking out. Can convert up to 5% of abandoned carts.', 'mailpoet'), 'description' => __('Send an email to logged-in visitors who have items in their shopping carts but left your website without checking out. Can convert up to 5% of abandoned carts.', 'mailpoet'),
'listingScheduleDisplayText' => _x('Send the email when a customer abandons their cart.', 'Description of Abandoned Shopping Cart email', 'mailpoet'), 'listingScheduleDisplayText' => _x('Send the email when a customer abandons their cart.', 'Description of Abandoned Shopping Cart email', 'mailpoet'),
'afterDelayText' => __('after cart abandoned', 'mailpoet'),
'badge' => [ 'badge' => [
'text' => __('Must-have', 'mailpoet'), 'text' => __('Must-have', 'mailpoet'),
'style' => 'red', 'style' => 'red',
], ],
'timeDelayValues' => [ 'timeDelayValues' => [
'minutes' => [ 'minutes' => [
'text' => _x('30 minutes after last page loaded', 'This is a trigger setting. It means that we will send an automatic email to a visitor 30 minutes after this visitor had left the website.', 'mailpoet'), 'text' => _x('30 minutes', 'This is a trigger setting. It means that we will send an automatic email to a visitor 30 minutes after this visitor had left the website.', 'mailpoet'),
'displayAfterTimeNumberField' => false, 'displayAfterTimeNumberField' => false,
], ],
'hours' => [ 'hours' => [
'text' => __('hour(s) later', 'mailpoet'), 'text' => __('hour(s)', 'mailpoet'),
'displayAfterTimeNumberField' => true, 'displayAfterTimeNumberField' => true,
], ],
'days' => [ 'days' => [
'text' => __('day(s) later', 'mailpoet'), 'text' => __('day(s)', 'mailpoet'),
'displayAfterTimeNumberField' => true, 'displayAfterTimeNumberField' => true,
], ],
'weeks' => [ 'weeks' => [
'text' => __('week(s) later', 'mailpoet'), 'text' => __('week(s)', 'mailpoet'),
'displayAfterTimeNumberField' => true, 'displayAfterTimeNumberField' => true,
], ],
], ],

View File

@@ -75,6 +75,7 @@ class FirstPurchase {
'title' => __('First Purchase', 'mailpoet'), 'title' => __('First Purchase', 'mailpoet'),
'description' => __('Let MailPoet send an email to customers who make their first purchase.', 'mailpoet'), 'description' => __('Let MailPoet send an email to customers who make their first purchase.', 'mailpoet'),
'listingScheduleDisplayText' => __('Email sent when a customer makes their first purchase.', 'mailpoet'), 'listingScheduleDisplayText' => __('Email sent when a customer makes their first purchase.', 'mailpoet'),
'afterDelayText' => __('after first purchase', 'mailpoet'),
'badge' => [ 'badge' => [
'text' => __('Must-have', 'mailpoet'), 'text' => __('Must-have', 'mailpoet'),
'style' => 'red', 'style' => 'red',

View File

@@ -255,6 +255,8 @@
'reEngagementFrequencyWeek': _x('week', 'week in the sentence "1 week after inactivity"'), 'reEngagementFrequencyWeek': _x('week', 'week in the sentence "1 week after inactivity"'),
'reEngagementFrequencyWeeks': _x('weeks', 'weeks in the sentence "5 weeks after inactivity"'), 'reEngagementFrequencyWeeks': _x('weeks', 'weeks in the sentence "5 weeks after inactivity"'),
'whenToSendMail': __('When to send this email?'),
'selectEventToSendWelcomeEmail': __('When to send this welcome email?'), 'selectEventToSendWelcomeEmail': __('When to send this welcome email?'),
'selectEventToSendReEngagementEmail': __('When to send this re-engagement email?'), 'selectEventToSendReEngagementEmail': __('When to send this re-engagement email?'),