| 1 |
<?php |
| 2 |
add_filter( 'wpas_plugin_settings', 'wpas_core_settings_notifications', 5, 1 ); |
| 3 |
/** |
| 4 |
* Add plugin notifications settings. |
| 5 |
* |
| 6 |
* @param array $def Array of existing settings |
| 7 |
* |
| 8 |
* @return array Updated settings |
| 9 |
*/ |
| 10 |
function wpas_core_settings_notifications( $def ) { |
| 11 |
|
| 12 |
// translators: %1$s is the URL to the email template, %2$s is the target attribute for the link (e.g., "_blank"). |
| 13 |
$desc = __( 'Please note that the <a href="%1$s" target="%2$s">e-mail template we use</a> is optimized for all e-mail clients and devices. If you add additional fancy styling through the editors you should do so with caution in order to avoid breaking the layouts on some devices.', 'awesome-support' ); |
| 14 |
|
| 15 |
// translators: %s is the URL to the documentation. |
| 16 |
$desc1 = __( 'We include a default set of designs for the six core emails below. You can use these designs in other email templates by simply copying them to the target email template editor and modifying them there. You can also install new designs from the TICKETS->TOOLS->CLEANUP area. Samples of some of the email templates can be found in our <a href="%s">documentation</a>.', 'awesome-support' ); |
| 17 |
|
| 18 |
$settings = array( |
| 19 |
'email' => array( |
| 20 |
'name' => __( 'E-Mails', 'awesome-support' ), |
| 21 |
'options' => array( |
| 22 |
array( |
| 23 |
'type' => 'note', |
| 24 |
'desc' => __( 'For more information about the template tags that can be used in e-mail templates please click the «Help» button in the top right hand corner of this screen.', 'awesome-support' ) |
| 25 |
), |
| 26 |
array( |
| 27 |
'name' => __( 'Global E-Mail Template', 'awesome-support' ), |
| 28 |
'desc' => __( 'The HTML E-Mail Template options below controls how the logo, header and footer appear in ALL your outgoing Awesome Support emails. You can completely disable this global template if necessary.', 'awesome-support' ), |
| 29 |
'type' => 'heading', |
| 30 |
), |
| 31 |
array( |
| 32 |
'name' => __( 'Use HTML Template', 'awesome-support' ), |
| 33 |
'id' => 'use_email_template', |
| 34 |
'type' => 'checkbox', |
| 35 |
'default' => true, |
| 36 |
'desc' => __( 'Outgoing notifications are styled with a built-in html template. If you are using an e-mail templating plugin you should deactivate this option.', 'awesome-support' ) |
| 37 |
), |
| 38 |
array( |
| 39 |
'type' => 'note', |
| 40 |
'desc' => wp_kses( sprintf( $desc, 'https://github.com/mailgun/transactional-email-templates', '_blank' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ) |
| 41 |
), |
| 42 |
array( |
| 43 |
'name' => __( 'Logo', 'awesome-support' ), |
| 44 |
'id' => 'email_template_logo', |
| 45 |
'type' => 'upload', |
| 46 |
'default' => '', |
| 47 |
'desc' => __( 'A logo that displays at the top of the e-mail notification.', 'awesome-support' ) |
| 48 |
), |
| 49 |
array( |
| 50 |
'name' => __( 'Header', 'awesome-support' ), |
| 51 |
'id' => 'email_template_header', |
| 52 |
'type' => 'editor', |
| 53 |
'default' => '<p>' . get_bloginfo( 'site_name' ) . '</p>', |
| 54 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 55 |
), |
| 56 |
array( |
| 57 |
'name' => __( 'Footer', 'awesome-support' ), |
| 58 |
'id' => 'email_template_footer', |
| 59 |
'type' => 'editor', |
| 60 |
'default' => '', |
| 61 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 62 |
), |
| 63 |
array( |
| 64 |
'name' => __( 'E-Mail Defaults', 'awesome-support' ), |
| 65 |
'type' => 'heading', |
| 66 |
), |
| 67 |
array( |
| 68 |
'name' => __( 'Sender Name', 'awesome-support' ), |
| 69 |
'id' => 'sender_name', |
| 70 |
'type' => 'text', |
| 71 |
'default' => get_bloginfo( 'name' ) |
| 72 |
), |
| 73 |
array( |
| 74 |
'name' => __( 'Sender E-Mail', 'awesome-support' ), |
| 75 |
'id' => 'sender_email', |
| 76 |
'type' => 'text', |
| 77 |
'default' => get_bloginfo( 'admin_email' ) |
| 78 |
), |
| 79 |
array( |
| 80 |
'name' => __( 'Reply-To E-Mail', 'awesome-support' ), |
| 81 |
'id' => 'reply_email', |
| 82 |
'type' => 'text', |
| 83 |
'default' => get_bloginfo( 'admin_email' ) |
| 84 |
), |
| 85 |
|
| 86 |
array( |
| 87 |
'name' => __( 'Email Contents', 'awesome-support' ), |
| 88 |
'desc' => __( 'Configure the contents of your emails below.', 'awesome-support' ), |
| 89 |
'type' => 'heading', |
| 90 |
), |
| 91 |
array( |
| 92 |
'name' => __( 'Design Notes', 'awesome-support' ), |
| 93 |
'id' => 'reply_design_notes', |
| 94 |
'type' => 'note', |
| 95 |
'desc' => sprintf( $desc1, 'https://getawesomesupport.com/documentation/awesome-support/admin-email-template-sets/' ), |
| 96 |
), |
| 97 |
array( |
| 98 |
'name' => __( 'Template Tags', 'awesome-support' ), |
| 99 |
'type' => 'note', |
| 100 |
'desc' => __( 'Email template tags allow you to insert real-time information into your outgoing emails. For example you can use tags to refer to the users name or the agent name. For more information about the template tags that can be used in e-mail templates please click the «Help» button in the top right hand corner of this screen. You can also click on the <b>{ }</b> icon in each of the editors for a pop-up list.', 'awesome-support' ) |
| 101 |
), |
| 102 |
/* Submission confirmation */ |
| 103 |
array( |
| 104 |
'name' => __( 'Submission Confirmation', 'awesome-support' ), |
| 105 |
'desc' => __( 'This is sent to the user when they open a new ticket.', 'awesome-support' ), |
| 106 |
'type' => 'heading', |
| 107 |
), |
| 108 |
array( |
| 109 |
'name' => __( 'Enable', 'awesome-support' ), |
| 110 |
'id' => 'enable_confirmation', |
| 111 |
'type' => 'checkbox', |
| 112 |
'default' => true, |
| 113 |
'desc' => __( 'Do you want to activate this e-mail template?', 'awesome-support' ) |
| 114 |
), |
| 115 |
array( |
| 116 |
'name' => __( 'Subject', 'awesome-support' ), |
| 117 |
'id' => 'subject_confirmation', |
| 118 |
'type' => 'text', |
| 119 |
'default' => __( 'Request received: {ticket_title}', 'awesome-support' ) |
| 120 |
), |
| 121 |
array( |
| 122 |
'name' => __( 'Content', 'awesome-support' ), |
| 123 |
'id' => 'content_confirmation', |
| 124 |
'type' => 'editor', |
| 125 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 126 |
), |
| 127 |
/* New assignment */ |
| 128 |
array( |
| 129 |
'name' => __( 'New Assignment', 'awesome-support' ), |
| 130 |
'desc' => __( 'This is sent to the agent when they are assigned to a ticket.', 'awesome-support' ), |
| 131 |
'type' => 'heading', |
| 132 |
), |
| 133 |
array( |
| 134 |
'name' => __( 'Enable', 'awesome-support' ), |
| 135 |
'id' => 'enable_assignment', |
| 136 |
'type' => 'checkbox', |
| 137 |
'default' => true, |
| 138 |
'desc' => __( 'Do you want to activate this e-mail template?', 'awesome-support' ) |
| 139 |
), |
| 140 |
array( |
| 141 |
'name' => __( 'Subject', 'awesome-support' ), |
| 142 |
'id' => 'subject_assignment', |
| 143 |
'type' => 'text', |
| 144 |
'default' => __( 'Ticket #{ticket_id} assigned', 'awesome-support' ) |
| 145 |
), |
| 146 |
array( |
| 147 |
'name' => __( 'Content', 'awesome-support' ), |
| 148 |
'id' => 'content_assignment', |
| 149 |
'type' => 'editor', |
| 150 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 151 |
), |
| 152 |
/* New reply from agent */ |
| 153 |
array( |
| 154 |
'name' => __( 'New Reply from Agent', 'awesome-support' ), |
| 155 |
'desc' => __( 'This is sent to the user when an agent replies to a ticket.', 'awesome-support' ), |
| 156 |
'type' => 'heading', |
| 157 |
), |
| 158 |
array( |
| 159 |
'name' => __( 'Enable', 'awesome-support' ), |
| 160 |
'id' => 'enable_reply_agent', |
| 161 |
'type' => 'checkbox', |
| 162 |
'default' => true, |
| 163 |
'desc' => __( 'Do you want to activate this e-mail template?', 'awesome-support' ) |
| 164 |
), |
| 165 |
array( |
| 166 |
'name' => __( 'Subject', 'awesome-support' ), |
| 167 |
'id' => 'subject_reply_agent', |
| 168 |
'type' => 'text', |
| 169 |
'default' => __( 'New reply to: {ticket_title}', 'awesome-support' ) |
| 170 |
), |
| 171 |
array( |
| 172 |
'name' => __( 'Content', 'awesome-support' ), |
| 173 |
'id' => 'content_reply_agent', |
| 174 |
'type' => 'editor', |
| 175 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 176 |
), |
| 177 |
/* New reply from client */ |
| 178 |
array( |
| 179 |
'name' => __( 'New Reply from Client', 'awesome-support' ), |
| 180 |
'desc' => __( 'This is sent to agents when a new reply is received from a user.', 'awesome-support' ), |
| 181 |
'type' => 'heading', |
| 182 |
), |
| 183 |
array( |
| 184 |
'name' => __( 'Enable', 'awesome-support' ), |
| 185 |
'id' => 'enable_reply_client', |
| 186 |
'type' => 'checkbox', |
| 187 |
'default' => true, |
| 188 |
'desc' => __( 'Do you want to activate this e-mail template?', 'awesome-support' ) |
| 189 |
), |
| 190 |
array( |
| 191 |
'name' => __( 'Subject', 'awesome-support' ), |
| 192 |
'id' => 'subject_reply_client', |
| 193 |
'type' => 'text', |
| 194 |
'default' => __( 'Ticket #{ticket_id}', 'awesome-support' ) |
| 195 |
), |
| 196 |
array( |
| 197 |
'name' => __( 'Content', 'awesome-support' ), |
| 198 |
'id' => 'content_reply_client', |
| 199 |
'type' => 'editor', |
| 200 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 201 |
), |
| 202 |
/* Ticket will close */ |
| 203 |
array( |
| 204 |
'name' => __( 'Ticket Will Be Closed', 'awesome-support' ), |
| 205 |
'desc' => __( 'These are sent as alerts to the user before a ticket is automatically closed (requires auto-close add-on otherwise this section is blank).', 'awesome-support' ), |
| 206 |
'type' => 'heading', |
| 207 |
), |
| 208 |
/* Ticket closed by agent */ |
| 209 |
array( |
| 210 |
'name' => __( 'Ticket Closed (by Agent)', 'awesome-support' ), |
| 211 |
'desc' => __( 'This is sent to the user when an agent closes a ticket.', 'awesome-support' ), |
| 212 |
'type' => 'heading', |
| 213 |
), |
| 214 |
array( |
| 215 |
'name' => __( 'Enable', 'awesome-support' ), |
| 216 |
'id' => 'enable_closed', |
| 217 |
'type' => 'checkbox', |
| 218 |
'default' => true, |
| 219 |
'desc' => __( 'Do you want to activate this e-mail template?', 'awesome-support' ) |
| 220 |
), |
| 221 |
array( |
| 222 |
'name' => __( 'Subject', 'awesome-support' ), |
| 223 |
'id' => 'subject_closed', |
| 224 |
'type' => 'text', |
| 225 |
'default' => __( 'Request closed: {ticket_title}', 'awesome-support' ) |
| 226 |
), |
| 227 |
array( |
| 228 |
'name' => __( 'Content', 'awesome-support' ), |
| 229 |
'id' => 'content_closed', |
| 230 |
'type' => 'editor', |
| 231 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 232 |
), |
| 233 |
array( |
| 234 |
'name' => __( 'Agents Can Suppress?', 'awesome-support' ), |
| 235 |
'id' => 'agents_can_suppress_closing_emails', |
| 236 |
'type' => 'checkbox', |
| 237 |
'default' => false, |
| 238 |
'desc' => '<em>' . __( 'Can agents prevent a closing confirmation email from being sent to a customer? Note: If this enabled it only applies to the emails defined in the core plugin and not to emails created by add-ons such as our Notification or Business Rules Engine add-ons', 'awesome-support' ) . '</em>' |
| 239 |
), |
| 240 |
/* Ticket closed by client*/ |
| 241 |
array( |
| 242 |
'name' => __( 'Ticket Closed (by client)', 'awesome-support' ), |
| 243 |
'desc' => __( 'This is sent to the agent when a user closes a ticket.', 'awesome-support' ), |
| 244 |
'type' => 'heading', |
| 245 |
), |
| 246 |
array( |
| 247 |
'name' => __( 'Enable', 'awesome-support' ), |
| 248 |
'id' => 'enable_closed_client', |
| 249 |
'type' => 'checkbox', |
| 250 |
'default' => true, |
| 251 |
'desc' => __( 'Do you want to activate this e-mail template?', 'awesome-support' ) |
| 252 |
), |
| 253 |
array( |
| 254 |
'name' => __( 'Subject', 'awesome-support' ), |
| 255 |
'id' => 'subject_closed_client', |
| 256 |
'type' => 'text', |
| 257 |
'default' => __( 'Request closed: {ticket_title}', 'awesome-support' ) |
| 258 |
), |
| 259 |
array( |
| 260 |
'name' => __( 'Content', 'awesome-support' ), |
| 261 |
'id' => 'content_closed_client', |
| 262 |
'type' => 'editor', |
| 263 |
'settings' => array( 'quicktags' => true, 'textarea_rows' => 7 ) |
| 264 |
), |
| 265 |
) |
| 266 |
), |
| 267 |
); |
| 268 |
|
| 269 |
return array_merge( $def, apply_filters('wpas_settings_notifications', $settings ) ); |
| 270 |
|
| 271 |
} |