Adding data from multiple data fields to body of an email - InfoPath Dev
in

InfoPath Dev

Adding data from multiple data fields to body of an email

Last post 01-30-2009 10:53 AM by nucel. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-28-2009 10:53 AM

    • nucel
    • Not Ranked
    • Joined on 01-28-2009
    • Posts 6

    Adding data from multiple data fields to body of an email

    I am not using a "Submit" function in my form.  Rather, I am generating an email based upon an "if" statement based on other criteria.  And while the action is working, I am now unclear as to how to add specific information from the form to the body of the email so my users do not have to open the attachment unless they really need to.  Here is the code I have so far in Java Script:

     function msoxd_my_FITEligibility::OnAfterChange(eventObj)

    {

    var Eligibility = XDocument.DOM.selectSingleNode("my:IFSP/my:Plan/my:FITEligibility").text;

    if (Eligibility<5)

    {

     [email protected];

     bstrCC="";

     bstrBCC="";

    bstrSubject="EI Eligibility Data";

     bstrBody="<this is where I want data from the form to appear>";

     XDocument.UI.ShowMailItem(bstrTo, bstrCC, bstrBCC, bstrSubject, bstrBody);

     }

     }

     

    Thank you in advance!

  • 01-28-2009 06:16 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Adding data from multiple data fields to body of an email

    Hello Welcome to the Forums,

    You can add the data to body of the email as per your requirement. Which data you want to add in that body? Is that data from the form or any hard coded text?

    You can write the below line to get the data from the form and hard coded text,

    bstrBody="Email Body:" + XDocument.DOM.selectSingleNode("my:IFSP/my:Plan/my:FITEligibility").text + "entered";

  • 01-30-2009 10:53 AM In reply to

    • nucel
    • Not Ranked
    • Joined on 01-28-2009
    • Posts 6

    Re: Adding data from multiple data fields to body of an email

    Thank you so much for the response!  While I have figured out how to insert the fields that I need using your example here, the problem I am having now is how to put them each on a separate line of the email instead of all running together on one line.  Any ideas?  Thanks!

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.