[ 'action-0' => '#AD5B4B', 'action-50' => '#b7695a', 'action-100' => '#bf796c', 'action-200' => '#c78a7e', 'secondary-0' => '#DA993F', 'secondary-50' => '#dea454', 'secondary-100' => '#e2b06a', 'secondary-200' => '#e6bb7f', 'light' => '#fdfcfc', 'light-50' => '#f7f4f3', 'light-100' => '#f0ebea', 'light-200' => '#eae3e2', 'dark' => '#503d3a', 'dark-50' => '#594440', 'dark-100' => '#624b47', 'dark-200' => '#6b514d', 'action-contrast'=> '', 'secondary-contrast'=> '', ], 'content' => [ 'title' => get_bloginfo('name'), 'subjectPrefix' => '['.get_bloginfo('name').']', 'signature' => '

  — ♡ Madi Mori

', 'footer' => [ '

© ' . date('Y') . ' Tatty Soap

', '

Tatty Soap

' ] ], 'types' => [ 'newUser' => [ 'subject' => 'Welcome to Tatty Soap! Finish creating your account.', 'showPrefix' => true, ], 'resetPass' => [ 'subject' => 'Reset your Password' ], 'emailChange' => [ 'subject' => 'Successfully Changed Email' ], 'passwordChange' => [ 'subject' => 'Successfully Changed Password', ] ] ]; } /* * EXTEND WITH: * {string} $message: email content * {WP_User} $user: user * apply_filters * jvbNewUserEmail -> New user email content * add_filter('jvbNewUserEmail', 'customFunction', 10, 2); * jvbNewUserAdminEmail -> New User notification for admin * add_filter('jvbNewUserAdminEmail', 'customFunction', 10, 2); * jvbPasswordResetEmail -> Password Reset Email * {string} $message: email content * {string} $key * {string} $user_login, * {WP_User} $user_data * add_filter('jvbPasswordResetEmail', 'customFunction', 10, 4); * jvbEmailChangeRequestEmail -> Request for email change * {string} $message * {array} $oldUser * {array} newUser * add_filter('jvbEmailChangeRequestEmail', 'customFunction', 10, 3); * jvbEmailChangedEmail -> Notification that email successfully changed * {string} $message * {string} $confirm_url add_filter('jvbEmailChangedEmail', 'customFunction', 10, 2); * jvbPasswordChangeEmail -> Request for password change * {string} $message * {array} $oldUser * {array} $newUser * add_filter('jvbPasswordChangeEmail', 'customFunction', 10, 3); * jvbPersonalDataExport -> Request for User Data * {string} $message * {string} $request_type * {string} $confirmation_url * {array} $emailData, from the original filter * add_filter('jvbPersonalDataExport', 'customFunction', 10, 4); * jvbPersonalDataExported -> Notification that data is ready for download * {string} $message * {string} $downloadURL * {string} $expiresAt * {array} $emailData, from the original filter * add_filter('jvbPersonalDataExported', 'customFunction', 10, ); * */ add_filter('jvbNewUserEmail', 'aei_new_user_email', 10, 2); function aei_new_user_email(string $message, WP_User $user):string { $user_login = $user->user_login; // Only create the password key if the user can change their password $key = get_password_reset_key($user); if (!is_wp_error($key)) { $reset_url = network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login'); $message = sprintf( '

Hey %s!

Thanks for signing up for a Tatty Soap account.

Login with your email: %s

To set your password and access your account, click the button below:

%s

Or copy and paste this link into your browser: %s

Or go passwordless, and just sign on with a magic link.

If you didn\'t create this account, just ignore this email and the link will expire.

', $user->display_name, $user->user_login, jvbMailButton($reset_url, 'Set Your Password'), jvbEmailLink($reset_url) ); } return $message; } /*** EDMONTON INK VERSIONS: ***/ function eink_new_user_email(string $message, WP_User $user):string { $user_login = $user->user_login; // Only create the password key if the user can change their password $key = get_password_reset_key($user); if (!is_wp_error($key)) { $reset_url = network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login'); $message = sprintf('

Hey %s!

', $user->first_name); $message .= '

Thanks for joining Edmonton\'s tattoo scene. Here\'s your login information:

'; $message .= sprintf('

Username: %s

', $user_login); $message .= '

To set your password and access your account, click the button below:

'; $message .= sprintf('

Set Your Password

', $reset_url); $message .= '

Or copy and paste this link into your browser:

'; $message .= sprintf('

%s

', $reset_url); $message .= '

This link will expire in 24 hours, for security reasons.

'; if (in_array('jvb_artist', array_values($user->roles))) { $message .= '
'; $message .= '

NOTE:

Once you set your password, you\'ll have access to your custom dashboard where you can:

Nothing will be published until you\'ve been approved by 3 already approved artists, or the admin.

Admins check every day or three, but, if you are in a rush, you can contact us directly by replying to this email, or texting us at 825-925-9916.

'; } elseif (in_array('jvb_partner', array_values($user->roles))) { $message .= '
'; $message .= '

NOTE:

Once you set your password, you\'ll have access to your custom dashboard where you can:

Nothing will be published until you\'ve been approved by the admin.

Admins check every day or three, but, if you are in a rush, you can contact us directly by replying to this email, or texting us at 825-925-9916.

Note:Even after approval by admin, your ability to publish depends on your karmic standing by artists. Artists each have a vote they can cast (UP or DOWN) - if your karmic score dips too far in the negative, you account is subject to reconsideration or even a ban.

'; } $message .= '
'; $message .= '

If you didn\'t create this account, please ignore this email and the link will expire.

'; $message .= sprintf('

Ink on, %s

', $user->first_name); } return $message; } function eink_new_user_admin_email(string $message, WP_User $user):string { $message .= sprintf( '

Role: %s

', str_replace(BASE, '', array_values($user->roles)[0]) ); return $message; } function eink_password_reset_email(string $message, string $user_login, WP_User $user, string $resetUrl):string { return sprintf( '

Hi bud,

We received a request to reset the password for an account associated with this email:

Username: %s

If you didn\'t make this request, you can safely ignore this email and nothing will happen to your account.

To reset your password, click the button below:

%s

Or copy and paste this link into your browser:

%s

This password reset link is only valid for 24 hours.

', $user_login, jvbMailButton($resetUrl,'Reset Password'), jvbEmailLink($resetUrl) ); } function eink_email_change_request_email(string $message, array $oldUser, array $newUser) { return sprintf( '

Hi %s,

Ideally you already know this: someone asked to change your email, and here we are.

Old Email: %s

New Email: %s

If this is news to you, or you did not request this - please contact us immediately. You can text us or reply to this email.">

%s', $newUser['first_name'], $oldUser['user_email'], $newUser['user_email'], jvbMailButton(wp_login_url(), 'Log In To Your Account') ); } function eink_email_changed_email(string $message, string $confirmURL):string { return sprintf( '

Hey human,

Seems you want to change the email associated with your account.

If you really want this, please confirm this change by clicking the button below:

%s

Or copy and paste this link into your browser:

%s', jvbMailButton($confirmURL, 'Confirm this Email'), jvbEmailLink($confirmURL) ); } function eink_password_changed_email(string $message, array $oldUser, array $newUser):string { return sprintf( '

Hey bud,

This is a confirmation email to let you know your password has successfully been changed.

Ideally, you\'re expecting this email. You wanted to change your password, and this is to let you know that it\'s definitely updated.

If you\'re not expecting this email, and did not change your password - please contact us immediately

You can text us, or reply to this email.

%s', jvbMailButton(wp_login_url(), 'Log In to Your Account') ); } function eink_personal_data_export(string $message, string $requestType, string $confirmURL, array $emailData):string { switch ($requestType) { case 'export_personal_data': $request_name = 'Export Personal Data'; break; case 'remove_personal_data': $request_name = 'Erase Personal Data'; break; default: $request_name = 'Data Request'; } return sprintf( '

Hi privacy enthusiast,

You\'re receiving this email because a request has been made to %s

If you\'re the one who made this request, you can confirm it by clicking the button below:

%s

Or copy and paste this link into your browser:

%s', $request_name, jvbMailButton($confirmURL, 'Confirm'), jvbEmailLink($confirmURL) ); } function eink_personal_data_exported_email(string $message, string $downloadURL, string $expiresAt, array $emailData):string { return sprintf( '

Hi again,

You\'re receiving this email because you requested an export of your personal data.

You can download your personal data by clicking the button below:

%s

Or you can copy and paste this link into your browser:

%s

Important: For privacy and security, this link will expire at %s.

', jvbMailButton($downloadURL, 'Download Your Data'), jvbEmailLink($downloadURL), $expiresAt ); }