Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎4 - Publisher Related‎ > ‎

Send Email

Will send an email using the publisher defined gateways.  This method provides an alternative email generation to eliminate dependency on GroupCommerce to maintain and update publisher email templates such as Refer Friends and Share Offer.  It is not required to use this method to send emails such as the publisher might have their own email gateway.

If the From and FromName are not supplied, the values configured inside PubAdmin will be used.

The TextBody is required as it is most important to have a default email body.  The HtmlBody if provided will be included as an multipart alternative content type for users who wish to receive emails in Html format.  (We know it is most of them)

Read more about mutlipart alternative.

Method: POST /api/v3/publisher/sendEmail

Authentication: oauth
 
Post
Required Form Name Data Type Explanation
No
From email
The from address for the email.  Will use publisher defined value if not present.
No
FromName string The from name for the email.  Will use publisher defined value if not present.
No HtmlBody string The html body for the email.
Yes
Subject string The subject for the email.
Yes
TextBody string The text body for the email.
Yes
To email
The to address for the recipient.
Yes
ToName string The to name for the recipient.

Returns
success - Whether the email was successfully sent.


Sample Request:

POST hhttps://api.groupcommerce.com/api/v3/publisher/sendEmail

Form:

HtmlBody=%3Cp%3EThis%20is%20the%20html%20body%20and%20will%20show%20up%20as%20an%20envelope%20for%20the%20email%20client%20to%20display%20based%20on%20the%20configruation%3C%2Fp%3E&Subject=The%20Subject%20of%20my%20email&TextBody=This%20is%20the%20text%20body%20and%20the%20default%20body%20of%20the%20email.&To=apisupport%40groupcommerce.com&ToName=Sylvester%20Martin


Authorization: OAuth oauth_signature="XZiT1EC3ubaPmF%2BBlr0sydaSfWE%3D", oauth_nonce="8764082", oauth_timestamp="1342055685", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"

Sample JSON Response:

{
    "errors":[],
    "lastPublished":"/Date(1319762442406)/",
    "success":true,
    "version":"3"
}


Sample XML Response:

<sendEmailResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <errors/>
    <lastPublished>2011-10-28T00:41:46.6073105Z</lastPublished>
    <success>true</success>
    <version>3</version>
</sendEmailResponse>

Comments