The official Terraform provider lets you describe your email templates in code, keep them under version control, and ship changes through CI/CD instead of editing them by hand in the dashboard. The provider is published on the Terraform Registry as skymanrm/fmailer.
The provider authenticates with a dedicated Terraform token. Create one on the token management page in the dashboard — for security it is shown only once, at the moment it is created. Pass it to the provider (typically via a variable or the FMAILER_TOKEN environment variable rather than hard-coding it).
terraform {
required_providers {
fmailer = {
source = "skymanrm/fmailer"
}
}
}
provider "fmailer" {
token = var.fmailer_token
} Each fmailer_template resource maps to one template. Reference the body from a file so the markup lives next to the rest of your code, and list the locales you support for localized sends.
resource "fmailer_template" "welcome" {
name = "welcome"
subject = "Welcome!"
locales = ["ru", "en"]
body = file("templates/welcome.html")
} Run terraform init once to download the provider, then terraform plan and terraform apply to push your templates to Postwing. Wire the same commands into your pipeline to deploy template changes automatically on merge.
terraform init && terraform apply