I've set up an UDT to send an email to a predefined email address when a user submit an event in frontend to CGCalendar (Via Event Manager).
But i would like to allow the editors of the site to set the destination email whitout giving them access to the UDT.
So i've used CustomGS a text field where editors can insert the destination email. But how do i get the field value and use in the UDT?
Using value from CustomGS in a User Defined Tag
Re: Using value from CustomGS in a User Defined Tag
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
[SOLVED] Using value from CustomGS in a User Defined Tag
Thanks! That did the trick.
It took me some time to figure out i had to use fetch to get it to work
The final UDT:
It took me some time to figure out i had to use fetch to get it to work
The final UDT:
Code: Select all
$event_title = $params['event_title'];
$event_id = $params['event_id'];
$event_date_start = $params['event_date_start'];
$subject = 'Ny pladsreservation oprettet [ID: '.$event_id.']';
$smarty_data = '{$CustomGS.Pladsreservation_email}';
$body = "En pladsreservation er oprettet i kalenderen med titel \"".$event_title ."\" og afventer godkendelse.\r\n";
$body .= "\r\n";
$mailer = new \cms_mailer;
$mailer->SetSubject($subject);
$mailer->SetBody($body);
$mailer->AddAddress($smarty->fetch('eval:'.$smarty_data));
$mailer->Send();

