I am using simplenews to send out a newsletter. I have a custom module. It has a table that relates a user code to the user's email.
email_address user_code
[email protected] 37XylT12
In the simplenews email I will send, the idea is that each user will receive a link with their usercode in it (i.e., http://www.domain.com/?q=go&c=37XylT12).
I've been attempting to create a custom token to place in the text of the newsletter and replaced with my custom link prior to send. However, I have two issues: 1) I cannot find an example of a token that includes a db_select query to return data and 2) I cannot find a way to access the simplenews email token ([simplenews-subscriber:mail]) in my custom module -- I need this value to lookup the code.
If someone could point me in the right direction, I would appreciate it. KMT