Skip to content

Instantly share code, notes, and snippets.

@msoler8785
Last active April 16, 2025 17:59
Show Gist options
  • Save msoler8785/39bab72f0ca90aa3aed4262978ece97c to your computer and use it in GitHub Desktop.
Save msoler8785/39bab72f0ca90aa3aed4262978ece97c to your computer and use it in GitHub Desktop.
SocketLabs Send Message With Meta Data
var client = new SocketLabsClient(ExampleConfig.ServerId, ExampleConfig.ApiKey)
{
    EndpointUrl = ExampleConfig.TargetApi
};

var message = new BasicMessage();

message.Subject = "Sending A Test Message";
message.HtmlBody = "<html>This is the Html Body of my message.</html>";
message.PlainTextBody = "This is the Plain Text Body of my message.";

message.From.Email = "[email protected]";
message.ReplyTo.Email = "[email protected]";

message.To.Add("[email protected]");

// Add Metadata
message.Metadata.Add(new Metadata("customer_id", "123456"));
message.Metadata.Add(new Metadata("campaign_id", "Free2Play"));

// Add tags
message.Tags.Add("foo");
message.Tags.Add("bar");
message.Tags.Add("baz");

return client.Send(message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment