Closed (fixed)
Project:
Signup
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
14 Aug 2009 at 21:38 UTC
Updated:
6 Sep 2009 at 15:50 UTC
Jump to comment: Most recent file
While working on #228159: Custom emails sent upon status change I decided it'd be nice to just use token.module for the token replacement stuff in signup_status_mailer. To do so, we need to expose some signup-related data as tokens, both node tokens (for node settings) and for 'signup' tokens (which will be supported directly by various signup-related modules) for data contained in a specific signup. Stay tuned for a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 549646-6.signup_tokens.patch | 10.51 KB | dww |
| #5 | 549646-5.signup_tokens.patch | 10.14 KB | dww |
| #4 | 549646-4.signup_tokens.patch | 9.66 KB | dww |
| #3 | 549646-3.signup_tokens.patch | 9.65 KB | dww |
| #2 | 549646-2.signup_tokens.patch | 8.33 KB | dww |
Comments
Comment #1
dwwWhile I was at it, I simplified some code to take advantage of theme('token_help') instead of our own custom version of that.
Comment #2
dwwIn testing, I noticed that during new signups,
$signup->signup_timewasn't being set. Now fixed.Comment #3
dwwGreggles balked at the variable named "curtime". ;) Here it is as "current_time".
Comment #4
dwwNow with filter_xss() on the custom signup form values, just to be safe. Since these tokens are used in plain text email, check_plain() isn't really what we want (and in fact, we don't even care about filter_xss(), either). However, if other modules start using these tokens in an HTML context, better safe than sorry, especially since these are entered by end users (even anonymous visitors). Also, to be extra paranoid, I cast the signup limit value to an int. ;)
Comment #5
dwwUpon further discussion, seems better to provide both regular and raw versions of this token, and let customers decide which to use as needed.
Also adds the attendance bit as another signup token.
Comment #6
dwwNow with a description on the token help fieldset encouraging users to choose the -raw versions where available, since this is for ASCII email.
Comment #7
dwwGiven the review(s) by greggles and more testing from me, committed to HEAD and DRUPAL-6--1.
Comment #8
dwwFollowup: Looking more closely at the default core tokens provided by token.module, it seems like '-' is used more frequently as the delimiter inside token names, not '_'. So, I just committed a change to switch from, e.g. [node_signup_limit] to [node-signup-limit] to both
HEAD and DRUPAL-6--1.
Comment #9
dwwFollow-up: There were cases where the 'mail' field isn't inside our happy $signup object, resulting in PHP notices. Cleaned up and fixed in HEAD and DRUPAL-6--1.