PHP Classes

Howto send bulk email quickly using Absint.

Recommend this page to a friend!

      Absint PHP Template Engine Trait  >  All threads  >  Howto send bulk email quickly using...  >  (Un) Subscribe thread alerts  
Subject:Howto send bulk email quickly using...
Summary:An example usage of Absint trait for a quick job.
Messages:1
Author:wim niemans
Date:2021-01-07 16:20:07
 

  1. Howto send bulk email quickly using...   Reply   Report abuse  
Picture of wim niemans wim niemans - 2021-01-07 16:20:07
The trait is very useful when you have to do a quick'n dirty job. Like bulk email.
Suppose you have to send a short email to a select user group. Just add the trait to your object $user and compose the short message.
Than $email = $user->parse($short_message, $variables).

Example of $short_message:
$short_message = <<<'EOSM'
Hello {userName),
you've registered at out website {website} on {register_date}. Thank you!.
This is a reminder to acknowledge that the registration reflects truely you. Please click <a href="{website}/{link}{userName}">here<a> or cut'n past the link {website}/{link}{userName} in your browser. Please acknowledge that this is you in the form. Thank you!
Greets from {website}.
<font size=-1>This email is sent to {email}, {firstName} {lastName}</font>
EOSM;

$variables = [
'register_date' => date("F j, Y, g:i a"),
'website' => 'https://example.com',
'link' => 'email_response.php?user='
];