33
Views
6
Comments
How to connect send email web sever action (SendEmailDemo) with mobile app
Question

Hi all,

I have a send email by web server action, I can send email by website (Link)

Now I need call SendEmailDemo server action by mobile app, I don't know how to connect?

Can you help me?




mvp_badge
MVP
Rank: #75

Hi Vinh,

You can check out this demo application in the Forge in order to understand how to send emails from Mobile Apps. It's basically the same thing as applies for Reactive Web Apps.

Also, here's another post that explains the steps.

Regards,

Nordin

mvp_badge
MVP
Rank: #75

Hi Vinh,

That's weird. It seems to be IPP protected which should not be the case if an application is uploaded to either the Forge or the Community Forum. I'll try to upload the OSP-file here again in order to see if the IPP protection is removed.

Please also post this error in the Forge discussion section of this component in order to notify the creator of the component and allow her to fix it.

Regards,

Nordin

Howto.Send.emails.from.a.Mobile.App1.0.0O11.osp

mvp_badge
MVP
Rank: #75

Hi Vinh,

So it didn't help to upload the OSP in this forum post as an attempt to remove the IPP protection. Like I said please let the creator of the Forge component know what's going on.

To go back to your initial problem, have you tried the steps described in this post?

Also I noticed you have created an ErrorMessage and Success input parameter for your SendEmailDemo server action. These should be output parameters which needs to be assigned accordingly after the SendEmailTest action. This way the calling client action from your mobile app can act upon the outcome of the SendEmailDemo server action output.


Regards,

Nordin

mvp_badge
MVP
Rank: #75

Hi Vinh,

Our posts have crossed each other :).

I see you have got it working. I'm glad you've figured it out.

Indeed using the GetUserId() function inside the email widget would not work, since you cannot rely on session data inside an email widget. Emails are being sent asynchronously and therefore run in a different session. 

If you want to show the user's name inside an email, you have to create an input parameter for it and pass GetUser(GetUserId()).User.Name to the input parameter of the Send Email tool. Inside the email widget you can use that input parameter inside an expression in order to display the user name.

Hope this makes it more clear.

Regards,

Nordin

P.S.: again, please mark the answer as solution that helped you the most.