It’s not so much a “no” or “hard no” or however you may visualize it, it’s more a “what could be done to help facilitate this type of usecase, while not making changes specifically for just this usecase”. Abstract things out and have a good place to store the information.
Regarding your idea of including data in the subject line, we do have something readily in place there to help, at least for majority of things. Word of warning, it is code-based so hopefully it’s not intimidating.
/**
* Filters the email subject to be sent to an admin.
*
* @since 1.3.0
*
* @param string $value Constructed email subject.
* @param string $value Constant Contact Form ID.
*/
apply_filters( 'constant_contact_email_subject', __( 'Constant Contact Forms Notification', 'constant-contact-forms' ), $submission_details['form_id'] )
If you’re familiar with WordPress filters and hooks at all, this should be pretty straightforward.
Basically, the default subject line is “Constant Contact Forms Notification”. With this filter, you could change it to whatever you wanted. As part of the filter, we provide the form ID that was submitted to, so you could conditionally act based on the form used.
As an example, if it was form ID 42, you could have the subject line be “Douglas Adams sends his fish”, otherwise, have it return the default above.
Regarding your usecase above, you could do something like this:
<?php
function mattsson_custom_email_subject( $default, $form_id ) {
if ( 42 === $form_id ) {
return 'Constant Contact Forms Notification in Chicago';
}
if ( 46 === $form_id ) {
return 'Constant Contact Forms Notification in New York City';
}
if ( 58 === $form_id ) {
return 'Constant Contact Forms Notification in San Francisco';
}
// Just return original if we have no found ID.
return $default;
}
add_filter( 'constant_contact_email_subject', 'mattsson_custom_email_subject', 10, 2 );
You would need to match up the IDs to which city should be listed.
Not foolproof solutions because forms can change and whatnot, but it’d work technically.