| 1 |
<?php |
| 2 |
namespace YayMail\Templates\DefaultTemplate; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
class CustomerResetPassword { |
| 7 |
|
| 8 |
protected static $instance = null; |
| 9 |
|
| 10 |
public static function getInstance() { |
| 11 |
if ( null == self::$instance ) { |
| 12 |
self::$instance = new self(); |
| 13 |
} |
| 14 |
|
| 15 |
return self::$instance; |
| 16 |
} |
| 17 |
|
| 18 |
public static function getTemplates() { |
| 19 |
/* |
| 20 |
@@@ Html default send email. |
| 21 |
@@@ Note: Add characters '\' before special characters in a string. |
| 22 |
@@@ Example: font-family: \'Helvetica Neue\'... |
| 23 |
*/ |
| 24 |
$emailTitle = __( 'Password Reset Request', 'woocommerce' ); |
| 25 |
$emailHi = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_customer_username]' ) . ',' ); |
| 26 |
$emailtext = esc_html__( 'Someone has requested a new password for the following account on ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_site_name]' ) . ':' ); |
| 27 |
$emailtext_1 = esc_html__( 'If you didn\'t make this request, just ignore this email. If you\'d like to proceed:', 'woocommerce' ); |
| 28 |
$textUserName = __( 'Username', 'woocommerce' ); |
| 29 |
$additionalContent = __( 'Thanks for reading.', 'woocommerce' ); |
| 30 |
|
| 31 |
/* |
| 32 |
@@@ Elements default when reset template. |
| 33 |
@@@ Note 1: Add characters '\' before special characters in a string. |
| 34 |
@@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif", |
| 35 |
|
| 36 |
@@@ Note 2: Add characters '\' before special characters in a string. |
| 37 |
@@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...." |
| 38 |
*/ |
| 39 |
|
| 40 |
// Elements |
| 41 |
$elements = |
| 42 |
'[ |
| 43 |
{ |
| 44 |
"id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe", |
| 45 |
"type": "Logo", |
| 46 |
"nameElement": "Logo", |
| 47 |
"settingRow": { |
| 48 |
"backgroundColor": "#ECECEC", |
| 49 |
"align": "center", |
| 50 |
"pathImg": "", |
| 51 |
"paddingTop": "15", |
| 52 |
"paddingRight": "0", |
| 53 |
"paddingBottom": "15", |
| 54 |
"paddingLeft": "0", |
| 55 |
"width": "172", |
| 56 |
"url": "#" |
| 57 |
} |
| 58 |
}, { |
| 59 |
"id": "802bfe24-7af8-48af-ac5e-6560a81345b3", |
| 60 |
"type": "ElementText", |
| 61 |
"nameElement": "Email Heading", |
| 62 |
"settingRow": { |
| 63 |
"content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . '</h1>", |
| 64 |
"backgroundColor": "#7f54b3", |
| 65 |
"textColor": "#ffffff", |
| 66 |
"family": "Helvetica,Roboto,Arial,sans-serif", |
| 67 |
"paddingTop": "36", |
| 68 |
"paddingRight": "48", |
| 69 |
"paddingBottom": "36", |
| 70 |
"paddingLeft": "48" |
| 71 |
} |
| 72 |
}, { |
| 73 |
"id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f", |
| 74 |
"type": "ElementText", |
| 75 |
"nameElement": "Text", |
| 76 |
"settingRow": { |
| 77 |
"content": "<p style=\"margin: 0 0 16px;\"><span style=\"font-size: 14px;\">' . $emailHi . '</span></p>\n<p style=\"margin: 0 0 16px;\"><span style=\"font-size: 14px;\">' . $emailtext . '</span></p>\n<p style=\"margin: 0 0 16px;\"><span style=\"font-size: 14px;\">' . $textUserName . ': [yaymail_customer_username]</span></p>\n<p style=\"margin: 0 0 16px;\"><span style=\"font-size: 14px;\">' . $emailtext_1 . '</span></p>\n<p style=\"margin: 0 0 16px;\"><span style=\"font-size: 14px;\">[yaymail_password_reset_url]</span></p>\n<p style=\"margin: 0 0 16px;\"><span style=\"font-size: 14px;\">' . $additionalContent . '</span></p>", |
| 78 |
"backgroundColor": "#fff", |
| 79 |
"textColor": "#636363", |
| 80 |
"family": "Helvetica,Roboto,Arial,sans-serif", |
| 81 |
"paddingTop": "32", |
| 82 |
"paddingRight": "48", |
| 83 |
"paddingBottom": "32", |
| 84 |
"paddingLeft": "48" |
| 85 |
} |
| 86 |
}, { |
| 87 |
"id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds", |
| 88 |
"type": "ElementText", |
| 89 |
"nameElement": "Footer", |
| 90 |
"settingRow": { |
| 91 |
"content": "<p style=\"font-size: 14px;margin: 0px 0px 16px; text-align: center;\">[yaymail_site_name] - Built with <a style=\"color: #7f54b3; font-weight: normal; text-decoration: underline;\" href=\"https://woocommerce.com\" target=\"_blank\" rel=\"noopener\">WooCommerce</a></p>", |
| 92 |
"backgroundColor": "#ececec", |
| 93 |
"textColor": "#8a8a8a", |
| 94 |
"family": "Helvetica,Roboto,Arial,sans-serif", |
| 95 |
"paddingTop": "15", |
| 96 |
"paddingRight": "50", |
| 97 |
"paddingBottom": "15", |
| 98 |
"paddingLeft": "50" |
| 99 |
} |
| 100 |
}]'; |
| 101 |
|
| 102 |
// Templates New Order |
| 103 |
$templates = array( |
| 104 |
'customer_reset_password' => array(), |
| 105 |
); |
| 106 |
|
| 107 |
$templates['customer_reset_password']['elements'] = $elements; |
| 108 |
return $templates; |
| 109 |
} |
| 110 |
} |
| 111 |
|