| 1 | <?php |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | defined( 'ZEROBSCRM_PATH' ) || exit( 0 ); |
| 13 | |
| 14 | function zeroBSCRM_mailTemplate_processEmailHTML( $content ) { |
| 15 | global $zbs; |
| 16 | |
| 17 | |
| 18 | |
| 19 | $content = wp_kses_post( $content ); |
| 20 | return $content; |
| 21 | } |
| 22 | |
| 23 | function zeroBSCRM_mailTemplate_emailPreview( $templateID = -1 ) { |
| 24 | |
| 25 | global $zbs; |
| 26 | |
| 27 | $html = ''; |
| 28 | $bodyHTML = ''; |
| 29 | |
| 30 | if ( $templateID > 0 ) { |
| 31 | |
| 32 | |
| 33 | $html = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 34 | $message_content = zeroBSCRM_mailTemplate_get( $templateID ); |
| 35 | if ( isset( $message_content->zbsmail_body ) ) { |
| 36 | $bodyHTML = $message_content->zbsmail_body; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | $placeholder_templating = $zbs->get_templating(); |
| 41 | |
| 42 | |
| 43 | |
| 44 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 45 | |
| 46 | if ( isset( $message_content->zbsmail_body ) ) { |
| 47 | $bodyHTML = $message_content->zbsmail_body; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | $subLine = __( 'This is a <b>Jetpack CRM email template preview</b><br/><em>This footer text is not shown in live emails</em>.', 'zero-bs-crm' ); |
| 52 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $html ); |
| 53 | |
| 54 | $replacements['unsub-line'] = $subLine; |
| 55 | $replacements['powered-by'] = zeroBSCRM_mailTemplate_poweredByHTML(); |
| 56 | $replacements['email-from-name'] = zeroBSCRM_mailDelivery_defaultFromname(); |
| 57 | |
| 58 | |
| 59 | if ( $templateID == 1 ) { |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | $replacements['email'] = 'your.user@email.com'; |
| 65 | $replacements['login-url'] = site_url( 'clients/login' ); |
| 66 | |
| 67 | |
| 68 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact' ), $html, $replacements ); |
| 69 | |
| 70 | } |
| 71 | |
| 72 | if ( $templateID == 2 ) { |
| 73 | |
| 74 | |
| 75 | $replacements['quote-title'] = __( 'Example Quotation #101', 'zero-bs-crm' ); |
| 76 | $replacements['quote-url'] = site_url( 'clients/login' ); |
| 77 | $replacements['quote-edit-url'] = admin_url(); |
| 78 | |
| 79 | |
| 80 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'quote', 'contact' ), $html, $replacements ); |
| 81 | |
| 82 | } |
| 83 | |
| 84 | if ( $templateID == 3 ) { |
| 85 | |
| 86 | |
| 87 | |
| 88 | $i = 0; |
| 89 | |
| 90 | $logo_url = ''; |
| 91 | |
| 92 | $logo_url = $zbs->urls['crm-logo']; |
| 93 | |
| 94 | |
| 95 | $lineitems = array( |
| 96 | array( |
| 97 | 'title' => __( 'Your Invoice Item', 'zero-bs-crm' ), |
| 98 | 'desc' => __( 'Your invoice item description goes here', 'zero-bs-crm' ), |
| 99 | 'quantity' => 5, |
| 100 | 'price' => 20, |
| 101 | 'net' => 100, |
| 102 | ), |
| 103 | array( |
| 104 | 'title' => __( 'Another Item', 'zero-bs-crm' ), |
| 105 | 'desc' => __( 'Some other description', 'zero-bs-crm' ), |
| 106 | 'quantity' => 3, |
| 107 | 'price' => 17, |
| 108 | 'net' => 51, |
| 109 | ), |
| 110 | ); |
| 111 | |
| 112 | $lineitems_header_html = zeroBSCRM_invoicing_generateInvPart_tableHeaders( 1 ); |
| 113 | $lineitem_html = zeroBSCRM_invoicing_generateInvPart_lineitems( $lineitems ); |
| 114 | |
| 115 | $replacements['title'] = __( 'Invoice Template', 'zero-bs-crm' ); |
| 116 | $replacements['invoice-title'] = __( 'Invoice', 'zero-bs-crm' ); |
| 117 | $replacements['logo-url'] = esc_url( $logo_url ); |
| 118 | |
| 119 | $inv_number = '2468'; |
| 120 | $inv_date_str = jpcrm_uts_to_date_str( 1931212800, false, true ); |
| 121 | $ref = '920592qz-42'; |
| 122 | |
| 123 | $totals_table = ''; |
| 124 | |
| 125 | $biz_info_table = ''; |
| 126 | |
| 127 | $biz_info_table = '<div style="text-align:right"><b>John Doe</b><br/>' . __( 'This is replaced<br>with the contacts details<br>from their profile.', 'zero-bs-crm' ) . '</div>'; |
| 128 | |
| 129 | |
| 130 | $replacements['invoice-number'] = $inv_number; |
| 131 | $replacements['invoice-date'] = $inv_date_str; |
| 132 | $replacements['invoice-ref'] = $ref; |
| 133 | $replacements['invoice-due-date'] = $inv_date_str; |
| 134 | $replacements['invoice-table-headers'] = $lineitems_header_html; |
| 135 | $replacements['invoice-line-items'] = $lineitem_html; |
| 136 | $replacements['invoice-totals-table'] = $totals_table; |
| 137 | $replacements['biz-info'] = $biz_info_table; |
| 138 | |
| 139 | $viewInPortal = ''; |
| 140 | $invoiceID = ''; |
| 141 | |
| 142 | |
| 143 | |
| 144 | if ( zeroBSCRM_isExtensionInstalled( 'portal' ) ) { |
| 145 | |
| 146 | |
| 147 | $viewInPortalURL = zeroBSCRM_portal_linkObj( $invoiceID, ZBS_TYPE_INVOICE ); |
| 148 | |
| 149 | |
| 150 | $viewInPortal = '<div style="text-align:center;margin:1em;margin-top:2em">' . zeroBSCRM_mailTemplate_emailSafeButton( $viewInPortalURL, __( 'View Invoice', 'zero-bs-crm' ) ) . '</div>'; |
| 151 | |
| 152 | } |
| 153 | |
| 154 | |
| 155 | $replacements['portal-view-button'] = $viewInPortal; |
| 156 | |
| 157 | |
| 158 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'invoice', 'contact', 'company' ), $html, $replacements ); |
| 159 | |
| 160 | } |
| 161 | |
| 162 | |
| 163 | if ( $templateID == 4 ) { |
| 164 | |
| 165 | $replacements['quote-title'] = __( 'Example Quotation #101', 'zero-bs-crm' ); |
| 166 | $replacements['quote-url'] = site_url( 'clients/login' ); |
| 167 | |
| 168 | $viewInPortal = ''; |
| 169 | $quoteID = ''; |
| 170 | |
| 171 | |
| 172 | |
| 173 | if ( zeroBSCRM_isExtensionInstalled( 'portal' ) ) { |
| 174 | |
| 175 | |
| 176 | $viewInPortalURL = zeroBSCRM_portal_linkObj( $quoteID, ZBS_TYPE_QUOTE ); |
| 177 | |
| 178 | |
| 179 | $viewInPortal = '<div style="text-align:center;margin:1em;margin-top:2em">' . zeroBSCRM_mailTemplate_emailSafeButton( $viewInPortalURL, __( 'View Proposal', 'zero-bs-crm' ) ) . '</div>'; |
| 180 | |
| 181 | } |
| 182 | |
| 183 | |
| 184 | $replacements['portal-view-button'] = $viewInPortal; |
| 185 | |
| 186 | |
| 187 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'quote', 'contact' ), $html, $replacements ); |
| 188 | } |
| 189 | |
| 190 | |
| 191 | if ( $templateID == 5 ) { |
| 192 | |
| 193 | $replacements['task-title'] = __( 'Example Task #101', 'zero-bs-crm' ); |
| 194 | $replacements['task-link'] = '<div style="text-align:center;margin:1em;margin-top:2em">' . zeroBSCRM_mailTemplate_emailSafeButton( admin_url(), __( 'View Task', 'zero-bs-crm' ) ) . '</div>'; |
| 195 | $replacements['contact-fname'] = __( 'First-Name', 'zero-bs-crm' ); |
| 196 | $replacements['contact-lname'] = __( 'Last-Name', 'zero-bs-crm' ); |
| 197 | $replacements['contact-fullname'] = __( 'Full-Name', 'zero-bs-crm' ); |
| 198 | |
| 199 | |
| 200 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'event' ), $html, $replacements ); |
| 201 | |
| 202 | } |
| 203 | |
| 204 | |
| 205 | if ( $templateID == 6 ) { |
| 206 | |
| 207 | $replacements['password'] = '********'; |
| 208 | $replacements['email'] = 'your.user@email.com'; |
| 209 | |
| 210 | |
| 211 | $html = $placeholder_templating->replace_placeholders( array( 'global' ), $html, $replacements ); |
| 212 | |
| 213 | } |
| 214 | |
| 215 | |
| 216 | if ( $templateID == 7 ) { |
| 217 | |
| 218 | |
| 219 | $html = $placeholder_templating->replace_placeholders( array( 'global' ), $html, $replacements ); |
| 220 | |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | return $html; |
| 225 | } |
| 226 | |
| 227 | |
| 228 | function zeroBSCRM_preview_email_template() { |
| 229 | |
| 230 | global $zbs; |
| 231 | |
| 232 | |
| 233 | if ( isset( $_GET['zbsmail-template-preview'] ) && $_GET['zbsmail-template-preview'] == 1 ) { |
| 234 | |
| 235 | |
| 236 | if ( current_user_can( 'admin_zerobs_manage_options' ) ) { |
| 237 | |
| 238 | $html = ''; |
| 239 | |
| 240 | if ( isset( $_GET['template_id'] ) && ! empty( $_GET['template_id'] ) ) { |
| 241 | |
| 242 | $templateID = (int) sanitize_text_field( $_GET['template_id'] ); |
| 243 | echo zeroBSCRM_mailTemplate_emailPreview( $templateID ); |
| 244 | |
| 245 | } else { |
| 246 | |
| 247 | |
| 248 | $placeholder_templating = $zbs->get_templating(); |
| 249 | |
| 250 | |
| 251 | $html = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 252 | |
| 253 | $message_content = ''; |
| 254 | $unsub_line = ''; |
| 255 | |
| 256 | |
| 257 | $message_content = "<h3 style='text-align:center;text-transform:uppercase'>Welcome to Jetpack CRM Email Templates</h3>"; |
| 258 | $unsub_line = __( 'Thanks for using Jetpack CRM', 'zero-bs-crm' ); |
| 259 | |
| 260 | |
| 261 | $message_content .= "<div style='text-align:center'>" . __( 'This is example content for the email template preview. <p>This content will be replaced by what you have in your system email templates</p>', 'zero-bs-crm' ) . '</div>'; |
| 262 | |
| 263 | |
| 264 | echo $placeholder_templating->replace_placeholders( |
| 265 | array( 'global', 'invoice' ), |
| 266 | $html, |
| 267 | array( |
| 268 | |
| 269 | 'title' => esc_html__( 'Template Preview', 'zero-bs-crm' ), |
| 270 | 'msg-content' => $message_content, |
| 271 | 'unsub-line' => esc_html( $unsub_line ), |
| 272 | 'powered-by' => zeroBSCRM_mailTemplate_poweredByHTML(), |
| 273 | 'email-from-name' => esc_html( zeroBSCRM_mailDelivery_defaultFromname() ), |
| 274 | |
| 275 | ) |
| 276 | ); |
| 277 | |
| 278 | } |
| 279 | |
| 280 | die( 0 ); |
| 281 | |
| 282 | } |
| 283 | } |
| 284 | } add_action( 'init', 'zeroBSCRM_preview_email_template' ); |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | function zeroBSCRM_mail_retrieveDefaultBodyTemplate( $template = 'maintemplate' ) { |
| 296 | |
| 297 | $templatedHTML = ''; |
| 298 | |
| 299 | if ( function_exists( 'file_get_contents' ) ) { |
| 300 | |
| 301 | |
| 302 | $acceptableTemplates = array( 'maintemplate', 'clientportal', 'invoicesent', 'quoteaccepted', 'quotesent', 'tasknotification', 'clientportalpwreset', 'invoicestatementsent' ); |
| 303 | |
| 304 | if ( in_array( $template, $acceptableTemplates ) ) { |
| 305 | |
| 306 | |
| 307 | if ( $template == 'maintemplate' ) { |
| 308 | $template = 'email-body'; |
| 309 | } |
| 310 | |
| 311 | try { |
| 312 | |
| 313 | |
| 314 | $templatedHTML = file_get_contents( ZEROBSCRM_PATH . 'html/templates/' . $template . '.html' ); |
| 315 | |
| 316 | } catch ( Exception $e ) { |
| 317 | |
| 318 | |
| 319 | |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | return $templatedHTML; |
| 325 | } |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | function zeroBSCRM_quote_generateNotificationHTML( $quoteID = -1, $return = true ) { |
| 338 | |
| 339 | global $zbs; |
| 340 | |
| 341 | if ( ! empty( $quoteID ) ) { |
| 342 | $quote_contact_id = $zbs->DAL->quotes->getQuoteContactID( $quoteID ); |
| 343 | $quote_contact = $zbs->DAL->contacts->getContact( $quote_contact_id ); |
| 344 | $html = ''; |
| 345 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 346 | |
| 347 | |
| 348 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 349 | |
| 350 | |
| 351 | if ( ! empty( $templatedHTML ) ) { |
| 352 | |
| 353 | |
| 354 | $bodyHTML = ''; |
| 355 | |
| 356 | |
| 357 | $placeholder_templating = $zbs->get_templating(); |
| 358 | |
| 359 | |
| 360 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 361 | |
| 362 | |
| 363 | $quote = zeroBS_getQuote( $quoteID, true ); |
| 364 | |
| 365 | if ( isset( $quote ) && is_array( $quote ) ) { |
| 366 | |
| 367 | $proposalTitle = ''; |
| 368 | if ( ! empty( $quote['title'] ) ) { |
| 369 | $proposalTitle = $quote['title']; |
| 370 | } |
| 371 | |
| 372 | |
| 373 | $zbs_biz_name = zeroBSCRM_getSetting( 'businessname' ); |
| 374 | $zbs_biz_yourname = zeroBSCRM_getSetting( 'businessyourname' ); |
| 375 | $zbs_biz_extra = zeroBSCRM_getSetting( 'businessextra' ); |
| 376 | $zbs_biz_youremail = zeroBSCRM_getSetting( 'businessyouremail' ); |
| 377 | $zbs_biz_yoururl = zeroBSCRM_getSetting( 'businessyoururl' ); |
| 378 | $zbs_settings_slug = admin_url( 'admin.php?page=' . $zbs->slugs['settings'] ) . '&tab=quotes'; |
| 379 | $quote_url = zeroBSCRM_portal_linkObj( $quoteID, ZBS_TYPE_QUOTE ); |
| 380 | $proposalEmailTitle = __( 'Proposal Notification', 'zero-bs-crm' ); |
| 381 | |
| 382 | |
| 383 | $message_content = zeroBSCRM_mailTemplate_get( ZBSEMAIL_NEWQUOTE ); |
| 384 | $bodyHTML = $message_content->zbsmail_body; |
| 385 | |
| 386 | |
| 387 | $replacements['quote-url'] = $quote_url; |
| 388 | $replacements['quote-title'] = $proposalTitle; |
| 389 | $replacements['quote-value'] = $quote['value'] ? zeroBSCRM_formatCurrency( $quote['value'] ) : ''; |
| 390 | |
| 391 | $viewInPortal = ''; |
| 392 | $quoteID = ''; |
| 393 | |
| 394 | if ( zeroBSCRM_isExtensionInstalled( 'portal' ) ) { |
| 395 | |
| 396 | $viewInPortalURL = zeroBSCRM_portal_linkObj( $quoteID, ZBS_TYPE_QUOTE ); |
| 397 | |
| 398 | $viewInPortal = '<div style="text-align:center;margin:1em;margin-top:2em">' . zeroBSCRM_mailTemplate_emailSafeButton( $viewInPortalURL, __( 'View Proposal', 'zero-bs-crm' ) ) . '</div>'; |
| 399 | } |
| 400 | |
| 401 | $replacements['portal-view-button'] = $viewInPortal; |
| 402 | |
| 403 | |
| 404 | $bodyHTML = $placeholder_templating->replace_placeholders( |
| 405 | array( 'global', 'quote', 'contact' ), |
| 406 | $bodyHTML, |
| 407 | $replacements, |
| 408 | array( |
| 409 | ZBS_TYPE_QUOTE => $quote, |
| 410 | ZBS_TYPE_CONTACT => $quote_contact, |
| 411 | ) |
| 412 | ); |
| 413 | |
| 414 | |
| 415 | |
| 416 | $bizInfoTable = '<table class="table zbs-table" style="width:100%;">'; |
| 417 | $bizInfoTable .= '<tbody>'; |
| 418 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;"><strong>' . $zbs_biz_name . '</strong></td></tr>'; |
| 419 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;">' . $zbs_biz_yourname . '</td></tr>'; |
| 420 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;">' . $zbs_biz_extra . '</td></tr>'; |
| 421 | $bizInfoTable .= '</tbody>'; |
| 422 | $bizInfoTable .= '</table>'; |
| 423 | |
| 424 | |
| 425 | $unsub_line = __( 'You have received this notification because a proposal has been sent to you', 'zero-bs-crm' ); |
| 426 | if ( isset( $zbs_biz_name ) && ! empty( $zbs_biz_name ) ) { |
| 427 | $unsub_line .= ' by ' . $zbs_biz_name; |
| 428 | } |
| 429 | $unsub_line .= '. ' . __( 'If you believe this was sent in error, please reply and let us know.', 'zero-bs-crm' ); |
| 430 | |
| 431 | |
| 432 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 433 | $replacements['title'] = $proposalEmailTitle; |
| 434 | $replacements['msg-content'] = $bodyHTML; |
| 435 | $replacements['unsub-line'] = $unsub_line; |
| 436 | $replacements['biz-info'] = $bizInfoTable; |
| 437 | |
| 438 | $settings = $zbs->settings->getAll(); |
| 439 | if ( $settings['currency'] && $settings['currency']['strval'] ) { |
| 440 | $replacements['quote-currency'] = $settings['currency']['strval']; |
| 441 | } |
| 442 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'quote' ), $templatedHTML, $replacements ); |
| 443 | |
| 444 | } |
| 445 | |
| 446 | |
| 447 | if ( ! $return ) { |
| 448 | |
| 449 | echo $html; |
| 450 | exit( 0 ); |
| 451 | |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | return $html; |
| 456 | |
| 457 | } |
| 458 | |
| 459 | return; |
| 460 | } |
| 461 | |
| 462 | |
| 463 | function zeroBSCRM_quote_generateAcceptNotifHTML( $quoteID = -1, $quoteSignedBy = '', $return = true ) { |
| 464 | |
| 465 | global $zbs; |
| 466 | |
| 467 | if ( ! empty( $quoteID ) ) { |
| 468 | $quote_contact_id = $zbs->DAL->quotes->getQuoteContactID( $quoteID ); |
| 469 | $quote_contact = $zbs->DAL->contacts->getContact( $quote_contact_id ); |
| 470 | |
| 471 | $html = ''; |
| 472 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 473 | |
| 474 | |
| 475 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 476 | |
| 477 | |
| 478 | $placeholder_templating = $zbs->get_templating(); |
| 479 | |
| 480 | |
| 481 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 482 | |
| 483 | |
| 484 | if ( ! empty( $templatedHTML ) ) { |
| 485 | |
| 486 | |
| 487 | $bodyHTML = ''; |
| 488 | |
| 489 | |
| 490 | $quote = zeroBS_getQuote( $quoteID, true ); |
| 491 | |
| 492 | if ( isset( $quote ) && is_array( $quote ) ) { |
| 493 | |
| 494 | $proposalTitle = ''; |
| 495 | if ( ! empty( $quote['title'] ) ) { |
| 496 | $proposalTitle = $quote['title']; |
| 497 | } |
| 498 | |
| 499 | $message_content = zeroBSCRM_mailTemplate_get( ZBSEMAIL_QUOTEACCEPTED ); |
| 500 | $bodyHTML = $message_content->zbsmail_body; |
| 501 | $proposalEmailTitle = __( 'Proposal Notification', 'zero-bs-crm' ); |
| 502 | $zbs_biz_name = zeroBSCRM_getSetting( 'businessname' ); |
| 503 | $zbs_biz_yourname = zeroBSCRM_getSetting( 'businessyourname' ); |
| 504 | $zbs_biz_extra = zeroBSCRM_getSetting( 'businessextra' ); |
| 505 | $zbs_biz_youremail = zeroBSCRM_getSetting( 'businessyouremail' ); |
| 506 | $zbs_biz_yoururl = zeroBSCRM_getSetting( 'businessyoururl' ); |
| 507 | |
| 508 | |
| 509 | $bodyHTML = $placeholder_templating->replace_placeholders( |
| 510 | array( 'global', 'quote', 'contact' ), |
| 511 | $bodyHTML, |
| 512 | $replacements, |
| 513 | array( |
| 514 | ZBS_TYPE_QUOTE => $quote, |
| 515 | ZBS_TYPE_CONTACT => $quote_contact, |
| 516 | ) |
| 517 | ); |
| 518 | |
| 519 | |
| 520 | |
| 521 | $bizInfoTable = '<table class="table zbs-table" style="width:100%;">'; |
| 522 | $bizInfoTable .= '<tbody>'; |
| 523 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;"><strong>' . $zbs_biz_name . '</strong></td></tr>'; |
| 524 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;">' . $zbs_biz_yourname . '</td></tr>'; |
| 525 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;">' . $zbs_biz_extra . '</td></tr>'; |
| 526 | |
| 527 | |
| 528 | $bizInfoTable .= '</tbody>'; |
| 529 | $bizInfoTable .= '</table>'; |
| 530 | |
| 531 | |
| 532 | $unsub_line = __( 'You have received this notification because your proposal has been accepted in CRM', 'zero-bs-crm' ); |
| 533 | |
| 534 | $unsub_line = __( 'You have received this notification because your proposal has been accepted in Jetpack CRM', 'zero-bs-crm' ); |
| 535 | |
| 536 | $unsub_line .= __( '. If you believe this was sent in error, please reply and let us know.', 'zero-bs-crm' ); |
| 537 | |
| 538 | |
| 539 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 540 | $replacements['title'] = $proposalEmailTitle; |
| 541 | $replacements['msg-content'] = $bodyHTML; |
| 542 | $replacements['unsub-line'] = $unsub_line; |
| 543 | $replacements['biz-info'] = $bizInfoTable; |
| 544 | $replacements['quote-url'] = zeroBSCRM_portal_linkObj( $quoteID, ZBS_TYPE_QUOTE ); |
| 545 | $replacements['quote-edit-url'] = jpcrm_esc_link( 'edit', $quoteID, 'zerobs_quote' ); |
| 546 | $replacements['quote-value'] = $quote['value'] ? zeroBSCRM_formatCurrency( $quote['value'] ) : ''; |
| 547 | |
| 548 | $settings = $zbs->settings->getAll(); |
| 549 | if ( $settings['currency'] && $settings['currency']['strval'] ) { |
| 550 | $replacements['quote-currency'] = $settings['currency']['strval']; |
| 551 | } |
| 552 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'quote' ), $templatedHTML, $replacements ); |
| 553 | |
| 554 | } |
| 555 | |
| 556 | |
| 557 | if ( ! $return ) { |
| 558 | |
| 559 | echo $html; |
| 560 | exit( 0 ); |
| 561 | |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | return $html; |
| 566 | |
| 567 | } |
| 568 | |
| 569 | |
| 570 | return; |
| 571 | } |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | |
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | |
| 583 | function zeroBSCRM_invoice_generateNotificationHTML( $invoiceID = -1, $return = true ) { |
| 584 | |
| 585 | if ( ! empty( $invoiceID ) && $invoiceID > 0 ) { |
| 586 | |
| 587 | global $zbs; |
| 588 | $invoice = $zbs->DAL->invoices->getInvoice( $invoiceID ); |
| 589 | |
| 590 | |
| 591 | $placeholder_templating = $zbs->get_templating(); |
| 592 | |
| 593 | |
| 594 | $mailTemplate = zeroBSCRM_mailTemplate_get( ZBSEMAIL_EMAILINVOICE ); |
| 595 | $bodyHTML = $mailTemplate->zbsmail_body; |
| 596 | |
| 597 | |
| 598 | $html = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 599 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $html ); |
| 600 | |
| 601 | |
| 602 | if ( ! empty( $html ) ) { |
| 603 | |
| 604 | |
| 605 | |
| 606 | $html = zeroBSCRM_invoicing_generateInvoiceHTML( $invoiceID, 'notification', $html ); |
| 607 | |
| 608 | |
| 609 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 610 | |
| 611 | |
| 612 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'invoice' ), $html, $replacements, array( ZBS_TYPE_INVOICE => $invoice ) ); |
| 613 | |
| 614 | |
| 615 | if ( ! $return ) { |
| 616 | |
| 617 | echo $html; |
| 618 | exit( 0 ); |
| 619 | |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | return $html; |
| 624 | |
| 625 | } |
| 626 | |
| 627 | |
| 628 | return; |
| 629 | } |
| 630 | |
| 631 | |
| 632 | function zeroBSCRM_statement_generateNotificationHTML( $contact_id = -1, $return = true ) { |
| 633 | |
| 634 | global $zbs; |
| 635 | |
| 636 | if ( ! empty( $contact_id ) ) { |
| 637 | $contact = $zbs->DAL->contacts->getContact( $contact_id ); |
| 638 | |
| 639 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 640 | |
| 641 | |
| 642 | $placeholder_templating = $zbs->get_templating(); |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | $mailTemplate = zeroBSCRM_mailTemplate_get( ZBSEMAIL_STATEMENT ); |
| 648 | $bodyHTML = $mailTemplate->zbsmail_body; |
| 649 | |
| 650 | |
| 651 | $html = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 652 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $html ); |
| 653 | |
| 654 | |
| 655 | if ( ! empty( $html ) ) { |
| 656 | |
| 657 | |
| 658 | $zbs_biz_name = zeroBSCRM_getSetting( 'businessname' ); |
| 659 | $zbs_biz_yourname = zeroBSCRM_getSetting( 'businessyourname' ); |
| 660 | $zbs_biz_extra = zeroBSCRM_getSetting( 'businessextra' ); |
| 661 | |
| 662 | |
| 663 | |
| 664 | $bizInfoTable = '<table class="table zbs-table" style="width:100%;">'; |
| 665 | $bizInfoTable .= '<tbody>'; |
| 666 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;"><strong>' . $zbs_biz_name . '</strong></td></tr>'; |
| 667 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;">' . $zbs_biz_yourname . '</td></tr>'; |
| 668 | $bizInfoTable .= '<tr><td style="font-family:sans-serif;font-size:14px;vertical-align:top;padding-bottom:5px;">' . $zbs_biz_extra . '</td></tr>'; |
| 669 | $bizInfoTable .= '</tbody>'; |
| 670 | $bizInfoTable .= '</table>'; |
| 671 | |
| 672 | |
| 673 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 674 | |
| 675 | |
| 676 | $replacements['title'] = __( 'Statement', 'zero-bs-crm' ); |
| 677 | $replacements['biz-info'] = $bizInfoTable; |
| 678 | |
| 679 | |
| 680 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact' ), $html, $replacements, array( ZBS_TYPE_CONTACT => $contact ) ); |
| 681 | |
| 682 | |
| 683 | if ( ! $return ) { |
| 684 | |
| 685 | echo $html; |
| 686 | exit( 0 ); |
| 687 | |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | return $html; |
| 692 | |
| 693 | } |
| 694 | |
| 695 | return; |
| 696 | } |
| 697 | |
| 698 | |
| 699 | |
| 700 | |
| 701 | |
| 702 | |
| 703 | |
| 704 | |
| 705 | |
| 706 | |
| 707 | function zeroBSCRM_Portal_generateNotificationHTML( $pwd = -1, $return = true, $email = null, $contact_id = false ) { |
| 708 | |
| 709 | global $zbs; |
| 710 | |
| 711 | if ( ! empty( $pwd ) ) { |
| 712 | |
| 713 | $html = ''; |
| 714 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 715 | |
| 716 | |
| 717 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 718 | |
| 719 | |
| 720 | $placeholder_templating = $zbs->get_templating(); |
| 721 | |
| 722 | |
| 723 | if ( ! empty( $templatedHTML ) ) { |
| 724 | |
| 725 | |
| 726 | $message_content = zeroBSCRM_mailTemplate_get( ZBSEMAIL_CLIENTPORTALWELCOME ); |
| 727 | $bodyHTML = $message_content->zbsmail_body; |
| 728 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $templatedHTML ); |
| 729 | |
| 730 | |
| 731 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 732 | |
| 733 | |
| 734 | $replacements['title'] = __( 'Welcome to your Client Portal', 'zero-bs-crm' ); |
| 735 | $replacements['email'] = $email; |
| 736 | |
| 737 | |
| 738 | $replacement_objects = array(); |
| 739 | if ( $contact_id > 0 ) { |
| 740 | $replacement_objects[ ZBS_TYPE_CONTACT ] = zeroBS_getCustomer( $contact_id ); |
| 741 | } |
| 742 | |
| 743 | |
| 744 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact' ), $html, $replacements, $replacement_objects ); |
| 745 | |
| 746 | |
| 747 | if ( ! $return ) { |
| 748 | |
| 749 | echo $html; |
| 750 | exit( 0 ); |
| 751 | |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | return $html; |
| 756 | |
| 757 | } |
| 758 | |
| 759 | |
| 760 | return; |
| 761 | } |
| 762 | |
| 763 | |
| 764 | function zeroBSCRM_Portal_generatePWresetNotificationHTML( $pwd, $return, $contact ) { |
| 765 | |
| 766 | global $zbs; |
| 767 | |
| 768 | if ( ! empty( $pwd ) ) { |
| 769 | |
| 770 | $html = ''; |
| 771 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 772 | |
| 773 | |
| 774 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 775 | |
| 776 | |
| 777 | $placeholder_templating = $zbs->get_templating(); |
| 778 | |
| 779 | |
| 780 | if ( ! empty( $templatedHTML ) ) { |
| 781 | |
| 782 | $message_content = zeroBSCRM_mailTemplate_get( ZBSEMAIL_CLIENTPORTALPWREST ); |
| 783 | $bodyHTML = $message_content->zbsmail_body; |
| 784 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $templatedHTML ); |
| 785 | |
| 786 | |
| 787 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 788 | |
| 789 | |
| 790 | $replacements['title'] = __( 'Your Client Portal Password has been reset', 'zero-bs-crm' ); |
| 791 | $replacements['email'] = $contact['email']; |
| 792 | $replacements['password'] = $pwd; |
| 793 | |
| 794 | |
| 795 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact' ), $html, $replacements, array( ZBS_TYPE_CONTACT => $contact ) ); |
| 796 | |
| 797 | |
| 798 | if ( ! $return ) { |
| 799 | |
| 800 | echo $html; |
| 801 | exit( 0 ); |
| 802 | |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | return $html; |
| 807 | |
| 808 | } |
| 809 | |
| 810 | |
| 811 | return; |
| 812 | } |
| 813 | |
| 814 | function jpcrm_task_generate_notification_html( $return = true, $email = false, $task_id = -1, $task = false ) { |
| 815 | |
| 816 | global $zbs; |
| 817 | |
| 818 | |
| 819 | if ( ! zeroBSCRM_validateEmail( $email ) || $task_id < 1 ) { |
| 820 | return false; |
| 821 | } |
| 822 | |
| 823 | |
| 824 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 825 | |
| 826 | |
| 827 | $html = ''; |
| 828 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 829 | |
| 830 | |
| 831 | $placeholder_templating = $zbs->get_templating(); |
| 832 | |
| 833 | |
| 834 | if ( ! empty( $templatedHTML ) ) { |
| 835 | |
| 836 | |
| 837 | $message_content = zeroBSCRM_mailTemplate_get( ZBSEMAIL_TASK_NOTIFICATION ); |
| 838 | $bodyHTML = $message_content->zbsmail_body; |
| 839 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $templatedHTML ); |
| 840 | |
| 841 | |
| 842 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 843 | |
| 844 | |
| 845 | if ( ! is_array( $task ) ) { |
| 846 | |
| 847 | $task = $zbs->DAL->events->getEvent( $task_id ); |
| 848 | |
| 849 | } |
| 850 | |
| 851 | |
| 852 | $task_url = jpcrm_esc_link( 'edit', $task['id'], ZBS_TYPE_TASK ); |
| 853 | $task_html = '<p>' . nl2br( $task['desc'] ) . '</p>'; |
| 854 | $task_html .= '<hr /><p style="text-align:center">'; |
| 855 | $task_html .= __( 'Your task starts at ', 'zero-bs-crm' ) . '<strong>' . $task['start_date'] . '</strong><br/>'; |
| 856 | |
| 857 | $task_html .= '</p><hr />'; |
| 858 | |
| 859 | |
| 860 | $replacements['title'] = __( 'Your Task is starting soon', 'zero-bs-crm' ); |
| 861 | $replacements['task-title'] = '<h2>' . $task['title'] . '</h2>'; |
| 862 | $replacements['task-body'] = $task_html; |
| 863 | $replacements['task-link-button'] = '<div style="text-align:center;margin:1em;margin-top:2em">' . __( 'You can view your task at the following URL: ', 'zero-bs-crm' ) . '<br />' . zeroBSCRM_mailTemplate_emailSafeButton( $task_url, __( 'View Task', 'zero-bs-crm' ) ) . '</div>'; |
| 864 | |
| 865 | |
| 866 | $html = $placeholder_templating->replace_placeholders( |
| 867 | array( |
| 868 | 'global', |
| 869 | 'event', |
| 870 | 'contact', |
| 871 | 'company', |
| 872 | ), |
| 873 | $html, |
| 874 | $replacements, |
| 875 | array( |
| 876 | ZBS_TYPE_TASK => $task, |
| 877 | ZBS_TYPE_CONTACT => isset( $task['contact'] ) ? $task['contact'][0] : null, |
| 878 | ZBS_TYPE_COMPANY => isset( $task['company'] ) ? $task['company'][0] : null, |
| 879 | ) |
| 880 | ); |
| 881 | |
| 882 | |
| 883 | if ( ! $return ) { |
| 884 | |
| 885 | echo $html; |
| 886 | exit( 0 ); |
| 887 | |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | return $html; |
| 892 | } |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | |
| 899 | |
| 900 | |
| 901 | |
| 902 | |
| 903 | |
| 904 | |
| 905 | |
| 906 | |
| 907 | |
| 908 | |
| 909 | |
| 910 | function jpcrm_mailTemplates_single_send_templated( $return = true, $content = '', $title = '', $contact_object = false ) { |
| 911 | |
| 912 | global $zbs; |
| 913 | |
| 914 | $html = ''; |
| 915 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 916 | |
| 917 | |
| 918 | $placeholder_templating = $zbs->get_templating(); |
| 919 | |
| 920 | |
| 921 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 922 | |
| 923 | |
| 924 | if ( ! empty( $templatedHTML ) ) { |
| 925 | |
| 926 | |
| 927 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $content, $templatedHTML ); |
| 928 | |
| 929 | |
| 930 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 931 | $replacements['title'] = $title; |
| 932 | |
| 933 | |
| 934 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact', 'company' ), $html, $replacements, array( ZBS_TYPE_CONTACT => $contact_object ) ); |
| 935 | |
| 936 | |
| 937 | if ( ! $return ) { |
| 938 | echo $html; |
| 939 | exit( 0 ); |
| 940 | } |
| 941 | } |
| 942 | return $html; |
| 943 | } |
| 944 | |
| 945 | |
| 946 | |
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | |
| 952 | |
| 953 | function jpcrm_mailTemplates_generic_msg( $return = true, $content = '', $title = '' ) { |
| 954 | |
| 955 | global $zbs; |
| 956 | |
| 957 | $html = ''; |
| 958 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 959 | |
| 960 | |
| 961 | $placeholder_templating = $zbs->get_templating(); |
| 962 | |
| 963 | |
| 964 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 965 | |
| 966 | |
| 967 | if ( ! empty( $templatedHTML ) ) { |
| 968 | |
| 969 | |
| 970 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $content, $templatedHTML ); |
| 971 | |
| 972 | |
| 973 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 974 | $replacements['title'] = $title; |
| 975 | |
| 976 | |
| 977 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact', 'company' ), $html, $replacements ); |
| 978 | |
| 979 | |
| 980 | if ( ! $return ) { |
| 981 | echo $html; |
| 982 | exit( 0 ); |
| 983 | } |
| 984 | } |
| 985 | return $html; |
| 986 | } |
| 987 | |
| 988 | |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | function zeroBSCRM_mailDelivery_generateTestHTML( $return = true ) { |
| 998 | |
| 999 | global $zbs; |
| 1000 | |
| 1001 | $html = ''; |
| 1002 | $pWrap = '<p style="font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:15px;">'; |
| 1003 | |
| 1004 | |
| 1005 | $placeholder_templating = $zbs->get_templating(); |
| 1006 | |
| 1007 | |
| 1008 | $templatedHTML = jpcrm_retrieve_template( 'emails/default-email.html', false ); |
| 1009 | |
| 1010 | |
| 1011 | if ( ! empty( $templatedHTML ) ) { |
| 1012 | |
| 1013 | |
| 1014 | $bodyHTML = ''; |
| 1015 | |
| 1016 | $bodyHTML = "<div style='text-align:center'><h1>" . __( 'Testing Mail Delivery Option', 'zero-bs-crm' ) . '</h1>'; |
| 1017 | $bodyHTML .= '<p>' . __( "This is a test email, sent to you by Jetpack CRM. If you're receiving this loud and clear, it means your mail delivery setup has been successful, congratulations!", 'zero-bs-crm' ) . '</p>'; |
| 1018 | |
| 1019 | |
| 1020 | $bodyHTML .= '<p>' . __( 'Why not follow us on twitter to celebrate?', 'zero-bs-crm' ) . '</p>'; |
| 1021 | $bodyHTML .= '<p><a href="https://twitter.com/jetpackcrm">@jetpackcrm</a></p>'; |
| 1022 | |
| 1023 | |
| 1024 | $bodyHTML .= '</div>'; |
| 1025 | |
| 1026 | |
| 1027 | $html = $placeholder_templating->replace_single_placeholder( 'msg-content', $bodyHTML, $templatedHTML ); |
| 1028 | |
| 1029 | |
| 1030 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 1031 | $replacements['title'] = __( 'Testing Mail Delivery Option', 'zero-bs-crm' ); |
| 1032 | $replacements['biz-info'] = '<p>' . __( 'Sent from your friendly neighbourhood CRM.', 'zero-bs-crm' ) . '</p>'; |
| 1033 | $replacements['unsub-line'] = '<p>' . __( 'Have a great day.', 'zero-bs-crm' ) . '</p>'; |
| 1034 | |
| 1035 | |
| 1036 | $html = $placeholder_templating->replace_placeholders( array( 'global', 'contact', 'company' ), $html, $replacements ); |
| 1037 | |
| 1038 | |
| 1039 | if ( ! $return ) { |
| 1040 | echo $html; |
| 1041 | exit( 0 ); |
| 1042 | } |
| 1043 | } |
| 1044 | return $html; |
| 1045 | } |
| 1046 | |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 1056 | |
| 1057 | function zeroBSCRM_mailTemplate_poweredByHTML( $type = 'html' ) { |
| 1058 | |
| 1059 | |
| 1060 | global $zbs; |
| 1061 | $showpoweredby_public = $zbs->settings->get( 'showpoweredby_public' ) === 1 ? true : false; |
| 1062 | |
| 1063 | if ( $showpoweredby_public ) { |
| 1064 | |
| 1065 | if ( $type == 'html' ) { |
| 1066 | global $zbs; |
| 1067 | return sprintf( __( 'Powered by <a href="%s">Jetpack CRM</a>', 'zero-bs-crm' ), $zbs->urls['home'] ); |
| 1068 | |
| 1069 | } elseif ( $type == 'text' ) { |
| 1070 | |
| 1071 | return __( 'Powered by Jetpack CRM', 'zero-bs-crm' ); |
| 1072 | |
| 1073 | } |
| 1074 | } |
| 1075 | |
| 1076 | |
| 1077 | return ''; |
| 1078 | } |
| 1079 | |
| 1080 | function zeroBSCRM_mailTemplate_getHeaders( $templateID = -1 ) { |
| 1081 | |
| 1082 | if ( $templateID > 0 ) { |
| 1083 | |
| 1084 | $mailTemplate = zeroBSCRM_mailTemplate_get( $templateID ); |
| 1085 | |
| 1086 | |
| 1087 | $headers = array( 'Content-Type: text/html; charset=UTF-8' ); |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | if ( isset( $mailTemplate->zbsmail_bccto ) && ! empty( $mailTemplate->zbsmail_bccto ) ) { |
| 1095 | $headers[] = 'Bcc: ' . sanitize_email( $mailTemplate->zbsmail_bccto ); |
| 1096 | } |
| 1097 | } else { |
| 1098 | $headers = array( 'Content-Type: text/html; charset=UTF-8' ); |
| 1099 | } |
| 1100 | |
| 1101 | return $headers; |
| 1102 | } |
| 1103 | |
| 1104 | |
| 1105 | function zeroBSCRM_mailTemplate_emailSafeButton( $url = '', $str = '' ) { |
| 1106 | |
| 1107 | return '<div><!--[if mso]> |
| 1108 | <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="' . $url . '" style="height:53px;v-text-anchor:middle;width:200px;" arcsize="8%" stroke="f" fillcolor="#49a9ce"> |
| 1109 | <w:anchorlock/> |
| 1110 | <center> |
| 1111 | <![endif]--> |
| 1112 | <a href="' . $url . '" |
| 1113 | style="background-color:#49a9ce;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:700;line-height:53px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;">' . $str . '</a> |
| 1114 | <!--[if mso]> |
| 1115 | </center> |
| 1116 | </v:roundrect> |
| 1117 | <![endif]--></div>'; |
| 1118 | } |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | |
| 1124 | |
| 1125 | |
| 1126 | |
| 1127 | function zeroBSCRM_mailTemplate_genericReplaces( $html = '', $leave_existing_placeholders = true ) { |
| 1128 | |
| 1129 | global $zbs; |
| 1130 | |
| 1131 | |
| 1132 | $placeholder_templating = $zbs->get_templating(); |
| 1133 | |
| 1134 | |
| 1135 | $replacements = $placeholder_templating->get_generic_replacements(); |
| 1136 | |
| 1137 | |
| 1138 | return $placeholder_templating->replace_placeholders( array( 'global' ), $html, $replacements, $leave_existing_placeholders ); |
| 1139 | } |
| 1140 | |
| 1141 | |
| 1142 | |
| 1143 | |
| 1144 | |