Skip to content

Commit

Permalink
validation + test
Browse files Browse the repository at this point in the history
  • Loading branch information
coilysiren committed Nov 8, 2024
1 parent 52643a5 commit f2d43bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infra/app/app-config/env-config/notifications.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locals {

# Set to the email address to be used when sending emails.
# If enable_notifications is true, this is required.
sender_email = "coilysiren@${var.domain_name}"
sender_email = "coilysiren@not-my-domain-name.com"

# Configure the REPLY-TO email address if it should be different from the sender.
reply_to_email = "coilysiren@${var.domain_name}"
Expand Down
5 changes: 5 additions & 0 deletions infra/modules/notifications/resources/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ variable "name" {
variable "sender_email" {
type = string
description = "Email address to use to send notification emails"

validation {
condition = regex("^.+@${var.domain_name}$", var.sender_email)
error_message = "The sender_email value must be an email address from the configured domain."
}
}

variable "sender_display_name" {
Expand Down

0 comments on commit f2d43bf

Please sign in to comment.