E-mail setup

0
Hi there! Use case: in the app, users are able to send a request using a form. The manager can then accept or reject the request. Problem: When the manager clicks on ‘reject’, I want the possibility to send an e-mail to the requester. The manager should be able to add a message to the e-mail before sending.  I currently have the e-mail template module. I have the following microflow:     How can I make the template visable, so the manager can enter a text before sending it to the requester?
asked
3 answers
2

So on your page, there will be a reject button. Behind the reject button, make a custom nanoflow that does the following:

  1. Retrieve the email template
  2. Use a flow that's similar to the “Sub_CreateAndSendEmail” flow, but remove the part where it's actually sent or committed. This way you will only make the e-mail without sending it.
  3. Set the newly created e-mail as the return value of the subflow
  4. In your nanoflow, open a page where you show the newly created e-mail including the “htmlbody” or “plainbody” field (depending on your use case) of the e-mail. Your user can now edit the content field
  5. Put a button on the page for the user to send the e-mail. Add a microflow behind this button that copies the htmlbody text or plainbody text to the other field in the appropriate format, commits the e-mail and any attachments, sets the status of the request to rejected, and calls the IVK_SendMail microflow. After that you can close the page or go to whatever page you like.

 

 

answered
1
  1. Make a page where the request can be approved or denied (according to your use case, of course, this is just an example). Add a flow for each button.

  1. Create a 1-1 association between your “Request” entity and the “Email” entity. This way we can track which e-mail belongs to the request 
  2. Copy the flow “Sub_CreateAndSendEmail” to your own module and rename it to “Sub_CreateEmail" (because we're not going to send it yet).
  3. Open the copied flow. We're going to make a few changes here:
    1. Remove any microflow parameters you don't need, like “Order” and “Customer”. Add a new parameter called “Request”
    2. Remove both of the commits. We're not going to save anything yet until the approver enters the text for the e-mail

  1. In the “set email data based on the customer and template”, make set the association between email and request.
  1. Remove the “IVK_SendEmail” part (the last block in the flow). You now have a flow that create the email for you according to the template, but doesn't send the e-mail yet (and doesn't commit it to the database yet)
  1. Set the “NewEmail” as the return value of your microflow: 
  1. Open the flow that you used for the “approve button”. Use a microflow call to call your newly created microflow. Then, add a show page action that shows the page where your manager can add the e-mail content. Be sure to pass the Email object to the page:

 

  1. The page you created should automatically have all the Email fields on it. You will only leave the fields here that you want the user to fill out. If you have already preset everything except the content in your e-mail template, then just show the “plaintext” field

 

 

  1. Add a microflow call behind the “send mail” button. In this microflow, we will do 4 things:
    1. Set the status of the request to rejected (and commit)
    2. Commit the newly created any attachments that are attached to the email (the email itself will be committed in the next step)
    3. Send the e-mail with the IVK_SendMail flow that's standard in the e-mail module
    4. Go back to whichever page you want the user to go to

 

 

 

answered
-1

This is the flow behind the 'send’ button

answered