CalcBuilder Forum

Get email address from "Show send by email?"

User satatwork 2017-12-05 01:26:30

I want to change the Subject line to include the primary recipients email...i.e. the one entered via "Show send by email" mechanism.

For example...I'd like create a variable called SENDTO that has the email address in it so I can then manipulate the subject line like this
$subject=$subject." for ".SENDTO." - ".$dateandtime;

I tried SENDTO = $email.... and it works for the email sent to the recipient BUT for BCC recipients it doesn't and instead inserts the word ARRAY.

And even for the BCC recipients I want the subject to still have the email entered in the "Show send by email" field.


Moonsoft support 2017-12-05 10:01:36

when users click the 'send by email' option, the email filled is sent using 'email' variable. But this is an internal parameter, not one of your calculator fields, so in order to recover it at the calculator code you need to use standard joomla functions to get variables from the request:

$jinput = JFactory::getApplication()->input;

$emailentered = $jinput->get('email');

Here the official reference:

Regarding bcc data, this is a list of emails, so you need to recover each one inside the array if you want to concatenate to build a text. There is a php function which does exactly this:

Hope this helps, regards

List Manager

Build different lists for your site

Buy now!

Create dynamic calculators

Buy now!