I was experimenting with the new Notification module in combination with EventsManager module and FrontEndUsers module. In particular I wanted to:
- 1. Receive an email notification every time a FUE register himself to an event (or modify his registration).
- 2. Have FEU details included in email body.
- 3. Have event details included in email body.
For #2 no problem as well. You can write a custom scrict in the "Advanced" tab of the notification. An example script is given in the Notification module help, so you just need do copy-and-paste it.
On the contrary #3 was very tricky for me, and I spent quite a lot of time before finding a solution: I was not able to retrieve the informations from the EventList module itself because I don't have enough knowledge about those stuff.. I also tried to get the page url without success because it was getting the url of the page with the list of all the events, and not just the one to which the FEU just subscribed.
Finally I figured out a simpler solution: I'm getting the needed information from the template variables. Here is the code.
In the Advanced tab of the notification I added this code:
Code: Select all
// get all assigned template vars
$all_tpl_vars = $smarty->get_template_vars();
// pass the event url to the template
$params = $all_tpl_vars['actionparams'];
$smarty->assign('event',$params['orig_url']);
Hope this will save some time to somebody else
