Skip to content

Commit 700abdc

Browse files
committed
feature(email): add email serivce
1 parent e247508 commit 700abdc

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

backend/helm-chart/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ spec:
5555
value: {{ .Values.env.REDIS_HOST | quote }}
5656
- name: REDIS_PORT
5757
value: {{ .Values.env.REDIS_PORT | quote }}
58+
- name: ML_SERVICE_URL
59+
value: {{ .Values.env.ML_SERVICE_URL | quote }}
5860
{{- range $envVar, $secretKey := .Values.secrets.mapping }}
5961
- name: {{ $envVar }}
6062
valueFrom:

backend/helm-chart/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ secrets:
9090
MAIL_FROM: mail-from
9191
SENDGRID_API_KEY: sendgrid-api-key
9292
SENDGRID_FROM_EMAIL: sendgrid-from-email
93+
AZURE_EMAIL_CONNECTION_STRING: azure-email-connection-string
94+
AZURE_EMAIL_FROM: azure-email-from
9395
AZURE_STORAGE_CONNECTION_STRING: azure-storage-account-string
9496
AZURE_STORAGE_CONTAINER_NAME: azure-storage-container-name
9597
FRONTEND_URL_PROD: frontend-url-prod

infra/terraform-dev/main.tf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,41 @@ resource "azurerm_storage_container" "uploads" {
129129
container_access_type = "blob" # Public read access (like Twitter/Instagram)
130130
}
131131

132+
# Communication Services for Email
133+
resource "azurerm_communication_service" "main" {
134+
name = "acs-simple-app"
135+
resource_group_name = azurerm_resource_group.main.name
136+
data_location = "Europe"
137+
138+
tags = {
139+
Environment = "Development"
140+
}
141+
}
142+
143+
# Email Communication Service
144+
resource "azurerm_email_communication_service" "main" {
145+
name = "email-simple-app"
146+
resource_group_name = azurerm_resource_group.main.name
147+
data_location = "Europe"
148+
149+
tags = {
150+
Environment = "Development"
151+
}
152+
}
153+
154+
# Email Domain (Azure-managed domain - no DNS setup required)
155+
resource "azurerm_email_communication_service_domain" "main" {
156+
name = "AzureManagedDomain"
157+
email_service_id = azurerm_email_communication_service.main.id
158+
domain_management = "AzureManaged"
159+
}
160+
161+
# Link Communication Service to Email Domain
162+
resource "azurerm_communication_service_email_domain_association" "main" {
163+
communication_service_id = azurerm_communication_service.main.id
164+
email_service_domain_id = azurerm_email_communication_service_domain.main.id
165+
}
166+
132167
# Output values
133168
output "resource_group_name" {
134169
value = azurerm_resource_group.main.name
@@ -157,4 +192,14 @@ output "storage_connection_string" {
157192

158193
output "storage_container_name" {
159194
value = azurerm_storage_container.uploads.name
195+
}
196+
197+
output "email_connection_string" {
198+
value = azurerm_communication_service.main.primary_connection_string
199+
sensitive = true
200+
}
201+
202+
output "email_sender_address" {
203+
value = "DoNotReply@${azurerm_email_communication_service_domain.main.from_sender_domain}"
204+
description = "Email address to use as sender (from Azure-managed domain)"
160205
}

0 commit comments

Comments
 (0)