In testing out the ad_notify module, I've found that notifications are not actually being sent. In working to clean this up, I've found that token replacement is not working as advertised, either.

Comments

Jeremy’s picture

I have fixed the first half of this by defining hook_mail(). I'm now reviewing why tokens aren't being replaced. Looking at it further, it seems that some are replaced, and some aren't. I copied every single token definition and pasted it at the end of a standard email, which I then had sent to myself. This was the result:

From: 	jandrews@localhost
Reply-to: 	jandrews@localhost
To: 	jandrews@localhost
Subject: 	[%sitename ad] regular notification
Date: 	Sun, 29 Mar 2009 14:01:21 -0400 (EDT)
Message-id: 	<20090329180121.AD3EC55E121@wanderer>


Hello Jeremy,

   This is an automatically generated notification about your advertisement  
"another scheduling test" that is being displayed on the %sitename website.

   Your advertisement has been viewed %today_views times and clicked  
%today_clicks times today.  It was viewed %yesterday_views times and clicked  
%yesterday_clicks times yesterday.  It has been viewed %global_views times  
and clicked 0 times since it was activated on never.

   You will receive this email every 0 sec as long as the ad is active.  You  
can view additional statistics about this advertisement or update this  
notification at the following url:
     http://localhost/ad69/node/35

Regards,
  The %sitename Team

-
%siteurl

----------
35      The ID of the advertisement.
text    The type of ad.
approved        The status of the ad.
http://localhost/ad69/node/35   The url of the advertisement.
http://localhost/ad69/ad/redirect/35    The redirection url of the  
advertisement.
regular The type of event that has triggered this notification.
email every 0 sec as long as the ad is active.  A complete sentence describing  
the frequency this notification will be sent.
another scheduling test The title of the advertisement.
0       The number of comments attached to the advertisement.
03/29/2009 - 12:36      "Small" date format of when the advertisement was created.
Sun, 03/29/2009 - 12:36 "Medium" date format of when the advertisement was  
created.
Sunday, March 29, 2009 - 12:36  "Large" date format of when the advertisement  
was created.
never   "Small" date format when the advertisement was activated.
never   "Medium" date format of when the advertisement was activated.
never   "Large" date format of when the advertisement was activated.
never   "Small" date format of when the advertisement was expired.
never   "Medium" date format of when the advertisement was expired.
never   "Large" date format of when the advertisement was expired.
03/29/2009 - 14:30      "Small" date format of when the advertisement was  
automatically activated.
Sun, 03/29/2009 - 14:30 "Medium" date format of when the advertisement was  
automatically activated.
Sunday, March 29, 2009 - 14:30  "Large" date format of when the advertisement  
was automatically activated.
never   "Small" date format of when the advertisement was automatically  
expired.
never   "Medium" date format of when the advertisement was automatically  
expired.
never   "Large" date format of when the advertisement was automatically  
expired.
1000    The maximum number of times this advertisement is allowed to be viewed.
10      The maximum number of times this advertisement is allowed to be clicked.
0       All time impression statistics
0       All time click statistics.
%last_year_impressions  Ad impressions last year.
%last_year_clicks       Ad clicks last year.
%this_year_impressions  Ad impressions this year.
%this_year_clicks       Ad clicks this year.
%last_month_impressions Ad impressions last month.
%last_month_clicks      Ad clicks this month.
%this_month_impressions Ad impressions this month.
%this_month_clicks      Ad clicks this month.
%this_week_impressions  Ad impressions this week.
%this_week_clicks       Ad clicks this week.
%yesterday_impressions  Ad impressions yesterday.
%yesterday_clicks       Ad clicks yesterday.
%today_impressions      Ad impressions today.
%today_clicks   Ad clicks today.
%last_hour_impressions  Ad impressions last hour.
%last_hour_clicks       Ad clicks this hour.
%this_hour_impressions  Ad impressions this hour.
%this_hour_clicks       Ad clicks this hour.
Ad owner tokens
Jeremy  The username of the ad owner.
jandrews@localhost      The email address of the ad owner.
1       The user ID of the ad owner.
Global tokens
Jeremy  The name of the currently logged in user.
1       The user ID of the currently logged in user.
jandrews@localhost      The email address of the currently logged in user.
http://localhost/ad69   The url of the current Drupal website.
localhost       The name of the current Drupal website.
        The slogan of the current Drupal website.
        The mission of the current Drupal website.
jandrews@localhost      The contact email address for the current Drupal website.
Sun, 03/29/2009 - 13:01 The current date on the site's server.
Jeremy’s picture

Status: Active » Fixed

Another series of changes committed. Notifications are now being mailed, and all available tokens are being properly replaced.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.