Hi,

I have just implemented a Drupal 7 website, using the calendar and views modules, in order to have the upcoming events.

I installed simplenews, and now I would like to use its mailing list system to send an event reminder email to users that subscribed the list, 1h before the event.

The problem is that I do not have any idea about how to do that.
Can I have such scenario? How can I achieve this idea?

Thank you very much for any kind of help!

Comments

Jaypan’s picture

Are you asking how to do this with code, or with a module?

lixo1’s picture

I prefer the easiest way!
Please let me know what you have in mind.

Jaypan’s picture

Well, since you asked in the code section.

You need to define your mail using hook_mail(). You will assign a mail key that can differentiate it from other keys your module will provide. After you have defined this mail 'template' as it were, you can send mails with it using drupal_mail(). You use the key you created in hook_mail(), and pass any params you have through that function. The params can than be used in hook_mail() for any dynamic pieces, such as the user's name, and specific content data or whatnot.