C# Class SocketLabs.InjectionApi.CSharp.Samples

ファイルを表示 Open project: socketlabs/email-on-demand-examples

Public Methods

Method Description
SimpleInjectionApiTemplate ( int serverId, string yourApiKey, string apiUrl ) : void

This example uses generic JsonObject containers to create a POST request for sending one or more SMTP messages through Email-On-Demand. The JSON request generated by this sample code looks like this: { "ServerId": "YOUR SERVER ID HERE", "ApiKey": "YOUR API KEY HERE", "Messages": [{ "Subject": "API Template Example", "ApiTemplate": "1", "To": [{ "EmailAddress": "%%DeliveryAddress%%", "FriendlyName": "%%FirstName" }], "From": { "EmailAddress": "[email protected]", "FriendlyName": "The ABC Company" }, "MergeData": { "PerMessage": [ [ { "Field":"DeliveryAddress", "Value":"[email protected]" }, { "Field": "FirstName", "Value": "John" } ] ] } }] }

Method Details

SimpleInjectionApiTemplate() public static method

This example uses generic JsonObject containers to create a POST request for sending one or more SMTP messages through Email-On-Demand. The JSON request generated by this sample code looks like this: { "ServerId": "YOUR SERVER ID HERE", "ApiKey": "YOUR API KEY HERE", "Messages": [{ "Subject": "API Template Example", "ApiTemplate": "1", "To": [{ "EmailAddress": "%%DeliveryAddress%%", "FriendlyName": "%%FirstName" }], "From": { "EmailAddress": "[email protected]", "FriendlyName": "The ABC Company" }, "MergeData": { "PerMessage": [ [ { "Field":"DeliveryAddress", "Value":"[email protected]" }, { "Field": "FirstName", "Value": "John" } ] ] } }] }
public static SimpleInjectionApiTemplate ( int serverId, string yourApiKey, string apiUrl ) : void
serverId int
yourApiKey string
apiUrl string
return void