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_status 'signup' tokens (which will be supported directly by various signup-related modules) for data contained in a specific signup. Stay tuned for a patch.

see also #549646: Expose signup-related node and signup values to token.module

Comments

dww’s picture

Status: Active » Needs review
StatusFileSize
new2.74 KB
dww’s picture

StatusFileSize
new2.78 KB

Now with filter_xss(), just to be safe. The status name and description are entered by admins, not end users, but still. 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...

dww’s picture

StatusFileSize
new3.78 KB

Upon further discussion, seems better to provide both regular and raw versions of these tokens, and let customers decide which to use as needed.

dww’s picture

StatusFileSize
new3.78 KB

Now without the PHP syntax error. ;)

dww’s picture

StatusFileSize
new3.96 KB

After more elaborate testing, there are cases where $signup->status is empty (e.g. users who signed up for something before signup_status was enabled, etc). So, now we're a little more careful about initializing those token values to avoid PHP notices.

dww’s picture

Status: Needs review » Fixed

Given the review(s) by greggles and more testing from me, committed to HEAD.

dww’s picture

Followup: 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. [signup_status] to [signup-status] to HEAD.

Status: Fixed » Closed (fixed)

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