Skip to content

Commit

Permalink
Added SMTP Configurations to send mails
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed May 31, 2024
1 parent a7e2c93 commit 9604737
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions imageroot/actions/configure-module/10configure_next_config_vars
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ random_key = secrets.token_hex(16)
SECRET = data.get("NEXTAUTH_SECRET",random_key)
host = data.get("host")

# SMTP Configuration
rdb = agent.redis_connect(use_replica=True)
smtp_settings = agent.get_smarthost_settings(rdb)

## Set the default values
SMTP_HOST=smtp_settings['host']
# OPTIONAL: Defines the port to use for sending emails.
SMTP_PORT=smtp_settings['port']
# OPTIONAL: Defines the username to use with the SMTP server.
SMTP_USERNAME=smtp_settings['username']
# OPTIONAL: Defines the password to use with the SMTP server.
SMTP_PASSWORD=smtp_settings['password']
SMTP_FROM_NAME=f'"Documenso" <{smtp_settings["username"]}>'
# REQUIRED: Defines the email address to use as the from address.
SMTP_FROM_ADDRESS=smtp_settings['username']


NEXTAUTH_URL = data.get("NEXTAUTH_URL", f'https://{host}')
Expand All @@ -44,15 +59,15 @@ NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID = data.get("NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID"
NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY = data.get("NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY", "")

NEXT_PRIVATE_SMTP_TRANSPORT = data.get("NEXT_PRIVATE_SMTP_TRANSPORT", "")
NEXT_PRIVATE_SMTP_HOST = data.get("NEXT_PRIVATE_SMTP_HOST", "")
NEXT_PRIVATE_SMTP_PORT = data.get("NEXT_PRIVATE_SMTP_PORT", "")
NEXT_PRIVATE_SMTP_USERNAME = data.get("NEXT_PRIVATE_SMTP_USERNAME", "")
NEXT_PRIVATE_SMTP_PASSWORD = data.get("NEXT_PRIVATE_SMTP_PASSWORD", "")
NEXT_PRIVATE_SMTP_HOST = data.get("NEXT_PRIVATE_SMTP_HOST", SMTP_HOST)
NEXT_PRIVATE_SMTP_PORT = data.get("NEXT_PRIVATE_SMTP_PORT", SMTP_PORT)
NEXT_PRIVATE_SMTP_USERNAME = data.get("NEXT_PRIVATE_SMTP_USERNAME", SMTP_USERNAME)
NEXT_PRIVATE_SMTP_PASSWORD = data.get("NEXT_PRIVATE_SMTP_PASSWORD", SMTP_PASSWORD)
NEXT_PRIVATE_SMTP_APIKEY_USER = data.get("NEXT_PRIVATE_SMTP_APIKEY_USER", "")
NEXT_PRIVATE_SMTP_APIKEY = data.get("NEXT_PRIVATE_SMTP_APIKEY", "")
NEXT_PRIVATE_SMTP_SECURE = data.get("NEXT_PRIVATE_SMTP_SECURE", "")
NEXT_PRIVATE_SMTP_FROM_NAME = data.get("NEXT_PRIVATE_SMTP_FROM_NAME", "")
NEXT_PRIVATE_SMTP_FROM_ADDRESS = data.get("NEXT_PRIVATE_SMTP_FROM_ADDRESS", "")
NEXT_PRIVATE_SMTP_FROM_NAME = data.get("NEXT_PRIVATE_SMTP_FROM_NAME", SMTP_FROM_NAME)
NEXT_PRIVATE_SMTP_FROM_ADDRESS = data.get("NEXT_PRIVATE_SMTP_FROM_ADDRESS", SMTP_FROM_ADDRESS)

NEXT_PRIVATE_RESEND_API_KEY = data.get("NEXT_PRIVATE_RESEND_API_KEY", "")

Expand Down

0 comments on commit 9604737

Please sign in to comment.