Comments (15)
You can use {{subject}}
and substitution when creating Template in the SparkPost UI. In the subject field, set {{subject}}
which will be replaced with actual subject when sending from WordPress. Same for From Name.
from wordpress-sparkpost.
from wordpress-sparkpost.
@xfechx
No attachment came.
A few notes that may help
- You'll have to specify the template id in the plugin's settings page
- Use the Test email feature in the plugin page. If problem persists, post the debug information here.
from wordpress-sparkpost.
The template works without the substitution tags of {{subject}} and
{{from_email}} on the template UI.
How can I send you debug info?
On Tue, 19 Apr 2016, 00:08 rajumsys [email protected] wrote:
@xfechx https://github.com/xfechx
No attachment came.A few notes that may help
- You'll have to specify the template id in the plugin's settings page
- Use the Test email feature in the plugin page. If problem persists,
post the debug information here.—
You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub
#33 (comment)
from wordpress-sparkpost.
When you use test email in plugins settings page, you'll see a checkbox 'Show debug messages'. Check that on and it'll show some debug messages at top of settings page.
from wordpress-sparkpost.
Hi rajumsys,
I have made a test - and the subject works with the {{subject}} tag in the
Template UI, I also added {{from_email}} tag in the UI, however when doing
the test from sparkpost wp, i received an email with the format
{{from_email}}@xyz.com , which means that the from is not being
substituted... I think your plugin has issues substituting the headers
data, as I have seen quite some problems that people are having with
gravityforms, and with contact form 7.
On Tue, Apr 19, 2016 at 12:39 AM rajumsys [email protected] wrote:
When you use test email in plugins settings page, you'll see a checkbox
'Show debug messages'. Check that on and it'll show some debug messages at
top of settings page.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#33 (comment)
from wordpress-sparkpost.
I can confirm that {{from_email}} DOES NOT WORK, it doesn't get replaced as it should.
MANY wordpress plugins (including the extra popular gravityforms and contact form7) replace values from email headers depending on the actions; for instance, my sites can send email depending on the subject or actions, for example:
[email protected]
[email protected]
[email protected]
I am not sure if it's a sparkpost or the wordpress plugin issue, but it "forces" the from name, which is quite useless - it should have the flexibility to allow for other plugins to replace this data accordingly, not all emails coming from one site will be from the same "from email" name.
from wordpress-sparkpost.
It also has another critical issue when using templates:
This plugin also overrides any "reply-to", for instance with wpmandrill any email sent from gravityforms, which indicated a reply-to address, was properly sent with those headers.
This plugin forces the reply to be sent to the "from email", which is also quite useless, there are many emails in many organisations that are not actual inboxes, nor forwarders, so a reply-to is crucial.
from wordpress-sparkpost.
I can confirm that {{from_email}} DOES NOT WORK, it doesn't get replaced as it should.
AFAIK, you can't substitute from email
.
from wordpress-sparkpost.
So how can we have dynamically generated notifications like mandrill or
mailgun do?
I need my sites to fire up different from different addresses like
[email protected], [email protected], etc.
Its a very basic functionality of transactional emailing....
On Wed, 20 Apr 2016, 00:20 thehungrycoder [email protected] wrote:
I can confirm that {{from_email}} DOES NOT WORK, it doesn't get replaced
as it should.AFAIK, you can't substitute from email.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#33 (comment)
from wordpress-sparkpost.
@xfechx Technically, you should be able to substitute local part of the From Email. Like {{from_email}}@domain.com
(make sure there is no space in substitution tag). However, we haven't test it yet with wordpress plugin.
https://www.dropbox.com/s/6vmktj5u3y6gi83/Screenshot%202016-04-19%2010.37.59.png?dl=0
As of now, you can't substitute domain name.
I'm not totally sure, how from email
substitution will work in wordpress. another alternative is
- adding a filter for template selection (i mean currently you enter the template name in settings page; but if we add a filter, you can programmatically change what value we're passing to api)
- you create separate templates for different types of mails, and change the template name using the filter.
from wordpress-sparkpost.
I am getting this error:
Preparing request data
Request headers: Array( [User-Agent] => wordpress-sparkpost [Content-Type]
=> application/json [Authorization] =>
fd2e************************************)
Request body: {"recipients":[{"address":{"email":"[email protected]
","name":""}}],"content":{"from":{"email":"[email protected]","name":"WordPress"},"subject":"SparkPost
email test","headers":{"Date":"Wed, 20 Apr 2016 07:24:48
+0000","Message-ID":"[email protected]","X-Mailer":"PHPMailer
5.2.14 (https://github.com/PHPMailer/PHPMailer)"},"template_id":"website-template"},"options":{"open_tracking":true,"click_tracking":true},"substitution_data":{"content":"
Hurray!!</h3>
You've
got mail! <br/>
Regards,<br/><a
href="https://www.sparkpost.com">SparkPost</a>
WordPress plugin</p>","subject":"SparkPost email
test","from_name":"WordPress"}}
Making HTTP POST request to https://api.sparkpost.com/api/v1/transmissions
Response received
Response headers: Array( [cache-control] => no-cache, no-store
[content-type] => application/json [date] => Wed, 20 Apr 2016 07:24:49 GMT
[server] => msys-http [vary] => Accept [content-length] => 241 [connection]
=> Close)
Response body: { "errors": [ { "message": "Message generation rejected",
"description": "No Sending Domain found in From header", "code": "1902" }
], "results": { "total_rejected_recipients": 0,
"total_accepted_recipients": 1, "id": "30270959232090468" } }
On Wed, Apr 20, 2016 at 12:38 AM rajumsys [email protected] wrote:
@xfechx https://github.com/xfechx Technically, you should be able to
substitute local part of the From Email. Like {{from_email}}@domain.com
(make sure there is space in substitution tag). However, we haven't test it
yet with wordpress plugin.https://www.dropbox.com/s/6vmktj5u3y6gi83/Screenshot%202016-04-19%2010.37.59.png?dl=0
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#33 (comment)
from wordpress-sparkpost.
Did some digging here - a couple of notes:
You can indeed use a variable for from
when creating a template, you just need to create the template via API - our UI doesn't support a sub data for the entire from
field it only supports using substitution for the localpart.
Reply to is also able to be a variable, but again our UI does not support it.
Here's an example payload with html
, from
, subject
, and reply_to
set to variables.
{
"id" : "wordpress-testing",
"name" : "wp-sparkpost testing",
"published" : true,
"options": {
"open_tracking" : true,
"click_tracking" : true
},
"content": {
"html": " {{{content}}}",
"subject": "{{subject}}",
"from": "{{from}}",
"reply_to": "{{reply_to}}"
}
}
I'm going to go ahead and make some tweaks to make all this work if the template is created via API. We'll also need a support article we can link to from the WordPress settings UI.
I was able to modify the code as well to make all of the above work. I'll be submitting as a PR once I clean the code up a little bit.
from wordpress-sparkpost.
This update has been published with 2.3.0 - make sure to read through https://support.sparkpost.com/customer/portal/articles/2409547-using-templates-with-the-sparkpost-wordpress-plugin for implementation details.
from wordpress-sparkpost.
Greetings,
Has this feature for adding all specific email headers available through the web UI, rather than only the API?
A lot of users that have come through mandrill are using the template UI for importing their mandrill themes, and I assume a lot of people do not want to mess up with the API directly.
Kind regards,
from wordpress-sparkpost.
Related Issues (20)
- Allow option to raise email exceptions HOT 1
- Support adding Campaign tag HOT 1
- Newly installed sparkpost plugin, getting SSL error: Failed to enable crypto HOT 3
- Show admin-wide alert if plugin is not ready to send!
- BuddyPress not sent with SparkPost HOT 3
- Why is Content-Type unsupported? HOT 9
- API Transmission Endpoint Changes HOT 2
- Retry transmissions after 5xx Error HOT 1
- Sparkpost replaces the url with a custom url HOT 3
- Emails could not be sent. htmlentities() expects parameter 1 to be string, array given in xxx HOT 8
- Missing assets folder in plugin installation HOT 6
- Retry transmissions after cURL error
- QUIT
- Sparkpost for only one contact form?
- reply-to not working
- Disable SparkPost mailer using a PHP constant
- Plugin uses incorrect bounce domain HOT 1
- Wondering if this plugin is still being maintained? HOT 1
- Deprecated notice on WP 5.5 HOT 2
- Fatal error: Uncaught Error in PHPMailer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-sparkpost.