Using value from CustomGS in a User Defined Tag

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

Using value from CustomGS in a User Defined Tag

Post by webform »

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?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Using value from CustomGS in a User Defined Tag

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

[SOLVED] Using value from CustomGS in a User Defined Tag

Post by webform »

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:

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();
Locked

Return to “Modules/Add-Ons”