185
Views
4
Comments
Send an email in 3 layer architecture
Question

i want to send email from my application.  if in 3 layer architecture, in which module should I create it?

2025-12-15 09-29-24
Thibaut G

When sending an email from a web application, it's generally recommended to handle the email functionality on the back end (Core Module:Business Services) rather than the front end. Here's why:

Security: Sending emails often involves using sensitive information such as email server credentials. Performing this operation on the back end helps to keep these details more secure, as they are not exposed to the client-side code. If you send emails directly from the front end, your email server credentials would be visible to anyone who inspects the browser's developer tools.

Control: By handling email functionality on the back end, you have more control over the email generation and sending process. You can implement server-side logic to validate and sanitize inputs, format the email content, and handle errors more effectively.

Scalability: Back-end servers are typically more scalable than client-side applications. Handling email functionality on the server allows you to scale your email sending process more efficiently, especially when dealing with a large number of emails or a high volume of traffic.

Consistency: If the email functionality is implemented on the back end, you can ensure a consistent email sending process across different clients and devices. This is important for maintaining a cohesive user experience.


Here's a general flow you might follow:

1. User triggers action: User performs an action on the front end that requires sending an email (e.g., completing a form, signing up).

2. Front end communicates with back end: The front-end application sends a request to the back end, providing the necessary information for the email (e.g., recipient email address, subject, content).

3. Back end processes and sends email: The back end validates inputs, generates the email content, and uses appropriate libraries or services to send the email through an email server.

4. Response to the front end: The back end responds to the front end, indicating whether the email sending process was successful or if there were any errors.

2024-05-08 05-59-38
Gayatri Kapadi

Hi Soo Jin Park,

Please read this article it may help you

https://medium.com/doitlean/outsystems-application-architecture-emails-f0a481b9af8 

Thank you,

Gayatri

2024-05-08 06-29-37
Prince Aadil Khan Panwar

Hi Soo Jin Park,

as I read this 

Email should be in End- user

please go through the link 

https://medium.com/doitlean/outsystems-application-architecture-emails-f0a481b9af8

written by @Miguel Antunes 

Thanks

Prince


2023-03-03 06-59-12
Reemali patil

Hi @Soo Jin Park ,

In a 3-layer architecture :

Presentation Layer: Focus on the user interface, avoid handling email logic directly.

Business Logic Layer: Create a separate module (e.g., "EmailModule") for email-related operations. Implement actions for composing and sending emails.

Data Access Layer: Primarily for data storage, avoid placing email sending logic here.

you would create the email sending functionality in a dedicated module within the Business Logic Layer, such as "EmailModule." This module will handle the business logic associated with composing and sending emails, providing a clear and modular structure for your application. 

Thanks & Regards

Reemali.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.