156
Views
5
Comments
Solved
How to send email from service module when i trigger server action from reactive app

I have an application consist of two modules

Service App

Reactive App


All server actions and tables exist in service app , now i need send email when i trigger server action from the service module , unfortunatly i can use the email inside the server action in  the service module ! so whats the solution for this case ?





2023-12-28 15-13-10
Mauro Alviza
Solution

Hi Omar

You can send your emails from your reactive app. What you need to do is:

  • Go to the UI Flows, and create an Email Ui Flow, then create a screen for the Email, you can choose a layout or create an empty one.

  • Then, in that email screen, you need to put the input parameters that you want to use. For example, if you want to send some info with the name of your company, or the name of the customer you can do that. And you can change the email layout as you want.
  • When you have that done, you go to the Logic and create a server action called send email. What that action will do, is send the exact email screen that you crated as an email to the emails that you want.
  • In that email you need to put the input parameters that you put in the email screen, and the emails that you want to. If you have a list of emails to send, you can put as an input parameter that list and then send it like this.
  • Then, you need to build you email action. You just need to drag the send email action to the flow, and fill the parameters. If you have a email list as I showed, you need to use a for each so that the email can be send to all the emails in the list.
  • After that, you just need to have a trigger to the server action, like a button or something. And that's all.

I hope it helps. If you have more questions, let me now and if you want, send the oml file so I can help you. You can allways see the documentation about emails here

Cheers.


2023-12-28 15-13-10
Mauro Alviza
Solution

Oh ok, I think I understand now. You are talking about this service module?

If you do, yes it does not support. If your idea was to create a single module to support all the database, you should have created a Blank Module. Thats what's usually used to be the database, and create all the entities and server action you understand? The CS module, or the "Database module" is allways the Blank type.

You cannot create the email action in the service one.

I think you should learn a little bit about architecture, that can help you in further apps that you create. See this documentation about Architecture Best Practices and Architecture Canvas, I think it would help you.

Cheers.

2023-12-28 15-13-10
Mauro Alviza
Solution

Hi Omar

You can send your emails from your reactive app. What you need to do is:

  • Go to the UI Flows, and create an Email Ui Flow, then create a screen for the Email, you can choose a layout or create an empty one.

  • Then, in that email screen, you need to put the input parameters that you want to use. For example, if you want to send some info with the name of your company, or the name of the customer you can do that. And you can change the email layout as you want.
  • When you have that done, you go to the Logic and create a server action called send email. What that action will do, is send the exact email screen that you crated as an email to the emails that you want.
  • In that email you need to put the input parameters that you put in the email screen, and the emails that you want to. If you have a list of emails to send, you can put as an input parameter that list and then send it like this.
  • Then, you need to build you email action. You just need to drag the send email action to the flow, and fill the parameters. If you have a email list as I showed, you need to use a for each so that the email can be send to all the emails in the list.
  • After that, you just need to have a trigger to the server action, like a button or something. And that's all.

I hope it helps. If you have more questions, let me now and if you want, send the oml file so I can help you. You can allways see the documentation about emails here

Cheers.


UserImage.jpg
Omar AbdElhadi

but i am using service module to hold all servers actions ! i dont want to create server action in the reactive app

i want to send from server action exist in service moduel 

2023-12-28 15-13-10
Mauro Alviza

If you want to do that, the only change that you need to do is to create the server action in the service module, it has the send email action to. Then you can add depedencies to add the email server action to you reactive module. I think that can work out.

UserImage.jpg
Omar AbdElhadi

But the service moduel dose not support having mails 

2023-12-28 15-13-10
Mauro Alviza
Solution

Oh ok, I think I understand now. You are talking about this service module?

If you do, yes it does not support. If your idea was to create a single module to support all the database, you should have created a Blank Module. Thats what's usually used to be the database, and create all the entities and server action you understand? The CS module, or the "Database module" is allways the Blank type.

You cannot create the email action in the service one.

I think you should learn a little bit about architecture, that can help you in further apps that you create. See this documentation about Architecture Best Practices and Architecture Canvas, I think it would help you.

Cheers.

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