Workaround Sehedule: Email with placeholder

lori19

Active Member
Hi all!

I'm trying to run a scheduled email to multiple addresses.If I input the To: addresses manually, all is fine. If I generate my To: addresses dynamically using a calc element and insert the placeholder in the To: field, the test run produces an error:

Note an email address:
address1@email.com,address2@email.com,address3@email.com

I checked the calc element with phpmyadmin, it looks fine there.

Thanks!

Kindly,
Lorenz
 
Explode of "To" is done before placeholder replacement so a "To" placeholder must return a valid single email.
{placeh1},{placeh2} would do.
 
I see, thanks! But: Does this sequence make sense? I want to send an email to all registered, non-blockes Joomla users. I can easily generate a string with all those addresses, however, I am not sure how to generate the date in the format indicated above.
Am I missing something?

Kindly,
Lorenz
 
The usecase is thought to be "have a bunch of list rows, for every row replace the placeholders in To and Message with row data, send an email (to all those Tos ) for every row".

So for your case cron/email.php has to be modified with some additional explode and loop after the replacement (do you like to;))
or you can use the cron php plugin and do it "manually".
 
Got it! My use case is indeed not really ordinary: I'm experimenting with automating some data quality and security checks (like rows with no modification or users with no login for the last 6 months) using a special fabric list. The resulting form/detail view is then sent to all users.

I guess I will explore the "manual" way to avoid compromising future Fabrik updates.

Thanks for the explanations!

Kindly,
Lorenz
 
The modification of email-cron could be done in general for "multiple email placeholders" (but somebody must do it).

If you have more complex cases anyway I would go with the php.
There's a FabrikWorker for mailing
FabrikWorker::sendMail
Code:
    /**
     * Function to send an email
     *
     * @param   string   $from         From email address
     * @param   string   $fromName     From name
     * @param   mixed    $recipient    Recipient email address(es)
     * @param   string   $subject      email subject
     * @param   string   $body         Message body
     * @param   boolean  $mode         false = plain text, true = HTML
     * @param   mixed    $cc           CC email address(es)
     * @param   mixed    $bcc          BCC email address(es)
     * @param   mixed    $attachment   Attachment file name(s)
     * @param   mixed    $replyTo      Reply to email address(es)
     * @param   mixed    $replyToName  Reply to name(s)
     * @param   array    $headers      Optional custom headers, assoc array keyed by header name
     *
     * @return  boolean  True on success
     *
     * @since   11.1
     */
    public static function sendMail($from, $fromName, $recipient, $subject, $body, $mode = false,
        $cc = null, $bcc = null, $attachment = null, $replyTo = null, $replyToName = null, $headers = array())
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top