Download & Extend

Expose signup_status values to token.module

Project:Signup Status
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:dww
Status:closed (fixed)

Issue Summary

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

#1

Status:active» needs review
AttachmentSize
549648-1.signup_status_tokens.patch 2.74 KB

#2

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...

AttachmentSize
549648-2.signup_status_tokens.patch 2.78 KB

#4

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

AttachmentSize
549648-4.signup_status_tokens.patch 3.78 KB

#5

Now without the PHP syntax error. ;)

AttachmentSize
549648-5.signup_status_tokens.patch 3.78 KB

#6

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.

AttachmentSize
549648-6.signup_status_tokens.patch 3.96 KB

#7

Status:needs review» fixed

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

#8

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.

#9

Status:fixed» closed (fixed)

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