Single Send API -- setting custom subject

SOLVE
MeriB
Member

I am using the single send API to send emails via an internal dashboard at my company. I can set things like the "to" "from" and "replyTo" fields via this API, but it does not seem possible to set a new "subject" line for the email (instead of using the one built into the template whose id I am using). Is there a way to do this? If not, is it a feature in consideration for the future? 

RIght now our work around is to duplicate the template and change the subject title, but this is a bit unwieldy and leading to a lot of email templates. 

0 Upvotes
1 Accepted solution

Accepted Solutions
JBeatty
Solution
Top Contributor | Platinum Partner

Hi @MeriB,

 

I do not have access directly to the single send API addon, but I do have a few suggestions that might help. One of them is to add a personalization token into the subject line of the email.

Screenshot 2021-07-12 144334.png

 

 

This will personalize the email subject line based on a specific property of the contact, like for example a custom property you create called "subject line". Then in your single send API call you can include Contact properties within the body of your call see this API page. This will work, and this is a solution I have done in the past for clients through workflow automation, but the process should be very similar with the single send API.

 

Now, that will definitely work, but there might be a far cleaner way to do this, but I can not test it as I don't have access to the addon. On that same API page, it mentions including "Custom properties"; I believe if you send one of these custom properties along with your API call and in your email template set the subject line as something along the lines of "{{ custom.SUBJECT }}" this should allow you to modify your subject line on sending.

 

This would be much cleaner as it would not muddy up your contact record nor require a custom property, but again I can not test this as I do not have access to the single send API.

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

View solution in original post

1 Reply 1
JBeatty
Solution
Top Contributor | Platinum Partner

Hi @MeriB,

 

I do not have access directly to the single send API addon, but I do have a few suggestions that might help. One of them is to add a personalization token into the subject line of the email.

Screenshot 2021-07-12 144334.png

 

 

This will personalize the email subject line based on a specific property of the contact, like for example a custom property you create called "subject line". Then in your single send API call you can include Contact properties within the body of your call see this API page. This will work, and this is a solution I have done in the past for clients through workflow automation, but the process should be very similar with the single send API.

 

Now, that will definitely work, but there might be a far cleaner way to do this, but I can not test it as I don't have access to the addon. On that same API page, it mentions including "Custom properties"; I believe if you send one of these custom properties along with your API call and in your email template set the subject line as something along the lines of "{{ custom.SUBJECT }}" this should allow you to modify your subject line on sending.

 

This would be much cleaner as it would not muddy up your contact record nor require a custom property, but again I can not test this as I do not have access to the single send API.

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

View solution in original post