Jake Vanderwerf
4 hours ago ad01a2799464e36a3954abe14f84ab82d439da53
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
 
$jvbEmail = add_filter('jvb_email', 'altr_email');
 
function altr_email(array $defaults):array
{
    return [
        'colours'       => [
            'action-0'      => '#c85604',
            'action-50'     => '#dc5f04',
            'action-100'    => '#f06705',
            'action-200'    => '#fa710f',
            'secondary-0'   => '#90D932',
            'secondary-50'  => '#99dc43',
            'secondary-100' => '#a3df54',
            'secondary-200' => '#ace366',
            'light'         => '#fdf9f7',
            'light-50'      => '#fbf4ee',
            'light-100'     => '#faeee6',
            'light-200'     => '#f8e8dd',
            'dark'          => '#0d0a08',
            'dark-50'       => '#16110e',
            'dark-100'      => '#201914',
            'dark-200'      => '#292019',
            'action-contrast'=> '#c85604',
            'secondary-contrast'=> '#c85604',
        ],
        'content'       => [
            'title'             => get_bloginfo('name'),
            'subjectPrefix'     => '['.get_bloginfo('name').']',
            'signature'         => '<p>&emsp; —  ♡ Lynsey</p>',
            'footer'    => [
                '<p>&copy; ' . date('Y') . ' OT with Lynsey — Edmonton Occupational Therapist.</p>',
                '<p><a href="' . get_home_url() . '" class="text-link">OT with Lynsey</a></p>'
            ]
        ],
        'types' => [
            'newUser' => [
                'subject'       => 'Welcome to OT with Lynsey! 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, );
 *
 */