In newer versions of Webform (3.9 and higher), the e-mail Subject field is tokens-enabled even though it does not include a list of tokens below the field. The tokens for
%value[key] are the most useful tokens for generating dynamic subject lines.
Webform 2.x and older 3.x versions
To create a custom email subject using user submitted values you may do it in the following way:
- Add a new form component of the type "hidden". Let's call it "Email subject".
- Using the desired email subject in the original post for this issue as an example, in the default value field for this component enter:
Event enquiry from %cid[x] for %cid[y] in %cid[z]
The x, y, and z keys above should represent the component id numbers (cid) relating to the form's component fields for "name", "eventdate", and "city" (Hint: you can find the cid for a form component by mousing over it's Edit link in the table on the "Form components" page and noting the last argument in the link's url). It seems that %cid is set up in the module as a token for the array of the form's submitted values.
- Choose "Email subject" in the Component drop-down for the E-mail subject setting on the webform's Configuration page.
Naturally, this same technique will work for the "Email from name" and "Email from address" settings as well.