Email Configuration

Updated Jul 21, 2026
Email

Email Configuration

Email profiles are the sending accounts DataMagik uses when a script or automation sends mail. Configure one or more profiles here — Postmark, SendGrid, or SMTP (including Microsoft 365 with OAuth) — and pick which one is the default. This is separate from Email Templates, which control what the messages look like.

Email Configuration page listing a default Postmark profile and an SMTP profile
Each profile shows its provider, from-address, and verified status.

Adding a profile

  1. Click Add Profile.
  2. Choose the provider (Postmark, SendGrid, or SMTP) and enter its settings — API key or SMTP host, credentials, and the from-address. For Microsoft 365, SMTP uses OAuth2 (XOAUTH2); you authorize the mailbox once and DataMagik stores the grant.
  3. Save, then click Test to send a verification message and confirm the profile works. A working profile is marked Verified.
  4. Use Set Default to choose which profile is used when a message doesn't name one.

Using a profile from a script

Reference a profile by name, or omit it to use the default:

// Send with a specific profile
const result = email.send({ profile: "marketing", to: ["user@example.com"], subject: "Hello", ... });

// Send with the default profile, using a template
const result = email.sendWithTemplate("Welcome Email", { customerName: "John Doe", orderNumber: 123 });
If a profile shows a "Last error". A profile that recently failed to send displays its last error (for example an expired OAuth grant or a rejected mailbox). Re-run Test after fixing the credentials to clear it.
Related: Design the messages in Email Templates; trigger sends from the Script Engine or automations. To receive mail and trigger scripts, see Inbound Email.
Was this page helpful?