<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Send email from Quick Report app when user clicks submit button? in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871114#M3310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same question as Christina Chelf. What would the email URL look like? I haven't had any luck making that work. Also, how do you call the emailHandler? Does this function simply&amp;nbsp;enable a mailto pop-up or is there a way to have the email sent automatically, without having to be sent by the user?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Nov 2017 16:16:19 GMT</pubDate>
    <dc:creator>deleted-user-lwkurIII0T1f</dc:creator>
    <dc:date>2017-11-13T16:16:19Z</dc:date>
    <item>
      <title>Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871111#M3307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to send an email from the Quick Report mobile app?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When a user submits a report through the&amp;nbsp;app, I need to alert my customer that a report has been added. This is for public safety, so I do not want to "check" for a added record at intermittent periods, they need to be alerted immediately when a record is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The feature class lives in our enterprise SDE database and the feature service is published on our ArcGIS Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had previously set up a SQL Server database trigger, but I cannot get it to work properly. Even with an insert trigger, it still sends an email when a record is deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using AppStudio for ArcGIS (Desktop Edition) 1.4.18 and the quick report template.&lt;/P&gt;&lt;P&gt;App is currently in testing mode using AppStudio Player.&lt;/P&gt;&lt;P&gt;App needs to work in Android and iPhone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:43:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871111#M3307</guid>
      <dc:creator>KE</dc:creator>
      <dc:date>2017-03-24T20:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871112#M3308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can be easily done by adding one additional call while submitting the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that to send an email you need to make SMTP call to an email server usually done via web service&amp;nbsp;or proxy service or Amazon SES with API gateway or Google cloud functions or some other provider like Zapier to help you send emails. QML/AppStudio does not have native support to make SMTP calls directly (not recommended either). Once you have this established you can call this web endpoint while submitting the report with any information you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: Here is a link showing how PHP developers would do it:&amp;nbsp;&lt;A class="link-titled" href="http://php.net/manual/en/function.mail.php" title="http://php.net/manual/en/function.mail.php" rel="nofollow noopener noreferrer" target="_blank"&gt;PHP: mail - Manual&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have an&amp;nbsp;url&amp;nbsp;that can help you send email to your clients you can call this from the Quick Report app using NetworkRequest object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File: FeatureServiceManager.qml (under controls folder)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #800080;"&gt;1. Create a NetworkRequest object to call the webservice url to send an email

NetworkRequest &lt;/SPAN&gt;{
&amp;nbsp; id: emailHandler
&amp;nbsp; url: "&amp;lt;your http link to webservice&amp;gt;"
&amp;nbsp; method: "POST"
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #800000;"&gt;&amp;nbsp; onReadyStateChanged&lt;/SPAN&gt;:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;(&lt;SPAN style="color: #000000;"&gt;readyState&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;===&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;NetworkRequest&lt;/SPAN&gt;.DONE&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;){
&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #000000;"&gt;errorCode&lt;/SPAN&gt;!=0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log("Network error!");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something, may be retry later
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //success. &amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&amp;nbsp;&amp;nbsp;function sendEmail(recipients, heading, body) {&lt;BR /&gt; var obj = {};&lt;BR /&gt; obj.emailRecipients = recipients.toString();&lt;BR /&gt; obj.emailHeading = heading.toString();&lt;BR /&gt; obj.emailBody = body.toString();&lt;BR /&gt; send(obj)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;2. Call this new emailHandler when submitting report inside of the "&lt;SPAN style="color: #000000;"&gt;applyEdits" function at the end.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871112#M3308</guid>
      <dc:creator>SathyaPrasad</dc:creator>
      <dc:date>2021-12-12T10:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871113#M3309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is really helpful! I have a few questions:&lt;/P&gt;&lt;P&gt;I set up a Zapier account and set up an email to email zap. So when someone emails&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:Example.osu0cx@zapiermail.com"&gt;example.osu0cx@zapiermail.com&lt;/A&gt; it is sent to my inbox. Is this all i need for the "url" or do I need some somethign else?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to using QML, how exactly do I call the emailHandler in the applyEdits function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 02:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871113#M3309</guid>
      <dc:creator>ChristinaChelf2</dc:creator>
      <dc:date>2017-08-04T02:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871114#M3310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same question as Christina Chelf. What would the email URL look like? I haven't had any luck making that work. Also, how do you call the emailHandler? Does this function simply&amp;nbsp;enable a mailto pop-up or is there a way to have the email sent automatically, without having to be sent by the user?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 16:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871114#M3310</guid>
      <dc:creator>deleted-user-lwkurIII0T1f</dc:creator>
      <dc:date>2017-11-13T16:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871115#M3311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jennifer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you or another person is following the PHP example in Sathya's response above, the url would really just be a link to a .php page on a web server (ex: &lt;A href="http://www.yourwebserver.com/handlemail.php"&gt;http://www.yourwebserver.com/handlemail.php&lt;/A&gt;).&amp;nbsp; The handlemail.php would read the email's body passed via the POST request and use PHP to send an email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For zapier, or some other 3rd party service, the url should be denoted somewhere your account settings. Most likely that url will be to a REST service that accepts the POST request sent by NetworkRequest in the example above. You will most likely have to pass additional parameters such as a unique client id associated with your account along with the email body. The 3rd party service should tell you what to pass to the service.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for calling the sendEmail function, inside applyEdits function you would call emailHandler.sendEmail(recipients, heading, body); for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;emailHandler.sendEmail("&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:therecpients_email@you.com"&gt;therecpients_email@you.com&lt;/A&gt;&lt;SPAN&gt;", "A cool heading", "This is the email body");&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2017 05:19:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871115#M3311</guid>
      <dc:creator>JaysonWard</dc:creator>
      <dc:date>2017-11-14T05:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871116#M3312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I actually figured this out right after I posted that question. I might try to post my solution later today. Thanks for the reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2017 13:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871116#M3312</guid>
      <dc:creator>deleted-user-lwkurIII0T1f</dc:creator>
      <dc:date>2017-11-14T13:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Send email from Quick Report app when user clicks submit button?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871117#M3313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am also new to QML and want to find out how to call the emailHandler in the applyEdits function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2018 15:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/send-email-from-quick-report-app-when-user-clicks/m-p/871117#M3313</guid>
      <dc:creator>GiatriLalla</dc:creator>
      <dc:date>2018-09-03T15:25:20Z</dc:date>
    </item>
  </channel>
</rss>

