Building a circular email-letter with InfoPath?! - InfoPath Dev
in

InfoPath Dev

Building a circular email-letter with InfoPath?!

Last post 06-23-2009 02:17 AM by dreamsharepoint. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 05-29-2007 04:50 AM

    Building a circular email-letter with InfoPath?!

    Hello,

     

    I want to build an email form with InfoPath. The email form must be sent on multiple recipients.

     

    Scenario:

    I want to develop an InfoPath form based circular letter, like Microsoft Word it does (paste for each reception a new page in the same word document with the same content, but different content in the placeholder).

    On my SharePoint site is a link which opens a web browser enabled IP form. The form displayed a repeating table with many email addresses of different persons (coming from a SharePoint list). I want to select some of the email addresses with a checkbox. If the checkbox is selected, a repeating section is inserted on another view of the same InfoPath form. This repeating section contains the tree text fields “mailto”, “mailsubject” and “mailtext”. For sending the e-mail I used not the InfoPath functionality for sending emails as data connection because there are some problems which confirmed by Microsoft. However, I use the “sendingMail” method from the sharepoint.utlis.

     

    My questions:

    • How can I solve the problems with the checkboxes to select the receptions?  The reception comes as secondary data source from a SharePoint list.
    • Has anybody some c# code to insert a repeating section on another view, if the checkbox is selected?
  • 05-29-2007 12:54 PM In reply to

    Re: Building a circular email-letter with InfoPath?!

    Hi happydigit,

    As for your second question, you do not need to write code to insert a repeating section on the second view, since these two sections are mapped one-to-one.  Instead, simply add the three fields to the repeating section that you already have, but do not display them on the first view.  On the second view, drop another instance of the same repeating group onto the view, and then filter it so that it only shows rows where checked="true".

    I haven't used the web method you're talking about, could you provide a link to docs?  If you are sending the same e-mail to everyone then the web method should have a mechanism to specify multiple e-mail addresses.  If you are sending a slightly different e-mail to each recepient, then you will have to call the web method several times - which could take a while.  Try to avoid this if possible.  InfoPath works great with web services, you just need to put the right data in the right place before querying.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-30-2007 04:35 AM In reply to

    Re: Building a circular email-letter with InfoPath?!

    Hello Matt!

     

    Thanks for your answers. For your first answer (answer to my second question *g*) I meant also in such a way to have one repeating section as group which inherits the tree fields (mailto, mailsubject…). But how can I in dependency of the number of chosen recipients insert the repeating sections? If I use checkboxes they are disabled because the data comes only as secondary data source in IP. One possibility is to use buttons for each row (respectively for each mail recipient).  So I have to code something in the event handler…?!

     

    At the end all recipients gets the same text-template but there are some specifics like the name (Dear Mr. XXX). That’s why I use per email on section in a repeating section. At the end following code iterates for each repeating section for sending the mail:

     

     

    XPathNavigator mailTo = MainDataSource.CreateNavigator().SelectSingleNode("/my:email/my:editsection/my:to", NamespaceManager);

    XPathNavigator mailSubject = MainDataSource.CreateNavigator().SelectSingleNode("/my:email/my:editsection/my:subject", NamespaceManager);

    XPathNavigator sendingText = MainDataSource.CreateNavigator().SelectSingleNode("/my:email/my:emailsection/my:sendingText", NamespaceManager);

     

    SPWeb web = SPControl.GetContextWeb(System.Web.HttpContext.Current);

     

     if (SPUtility.IsEmailServerSet(web))

     {

       SPUtility.SendEmail(web, true, true, mailTo.ToString(), mailSubject.ToString(), sendingText.ToString());

     }

     

    Hope that helps to understand my problem.

  • 05-30-2007 04:35 AM In reply to

    Re: Building a circular email-letter with InfoPath?!

    Hello Matt!

     

    Thanks for your answers. For your first answer (answer to my second question *g*) I meant also in such a way to have one repeating section as group which inherits the tree fields (mailto, mailsubject…). But how can I in dependency of the number of chosen recipients insert the repeating sections? If I use checkboxes they are disabled because the data comes only as secondary data source in IP. One possibility is to use buttons for each row (respectively for each mail recipient).  So I have to code something in the event handler…?!

     

    At the end all recipients gets the same text-template but there are some specifics like the name (Dear Mr. XXX). That’s why I use per email on section in a repeating section. At the end following code iterates for each repeating section for sending the mail:

     

     

    XPathNavigator mailTo = MainDataSource.CreateNavigator().SelectSingleNode("/my:email/my:editsection/my:to", NamespaceManager);

    XPathNavigator mailSubject = MainDataSource.CreateNavigator().SelectSingleNode("/my:email/my:editsection/my:subject", NamespaceManager);

    XPathNavigator sendingText = MainDataSource.CreateNavigator().SelectSingleNode("/my:email/my:emailsection/my:sendingText", NamespaceManager);

     

    SPWeb web = SPControl.GetContextWeb(System.Web.HttpContext.Current);

     

     if (SPUtility.IsEmailServerSet(web))

     {

       SPUtility.SendEmail(web, true, true, mailTo.ToString(), mailSubject.ToString(), sendingText.ToString());

     }

     

    Hope that helps to understand my problem.

  • 05-30-2007 05:57 AM In reply to

    Re: Building a circular email-letter with InfoPath?!

    Hi Happydigit,

    The code looks alright, but I have never used this utility, so I don't know how else to advise you.  Does the utility have a forum? It seems like they would be more knowledgable on this subject.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-30-2007 08:42 AM In reply to

    Re: Building a circular email-letter with InfoPath?!

    Hey.

     

    The posted code is not the problem. As you said, the code works fine! I wrote it to give you a summary about my “solution”. It should help to understand my problem.

     

    So once again: How can I insert in IP 2007 (via code) a section in a repeating section?

    There is a repeating group in the IP data source. On “view 1” we have a table with 10 entries. For each entry we have a button named “mail”. So we have 10 buttons. The user clicks now on 5 buttons and IP must insert 5 repeating sections on “views 2”.

     

    How can I solve this?

  • 06-23-2009 02:17 AM In reply to

    Re: Send emails to multiple receipients listed in a Sharepoint Library one at a time

    Hi

    I have a similar issue, but a slightly different one.

    I have an Infopath  form library where all my clients are listed with their email addresses. Email address field is (Single Line of Text)

    What i would like to do is send an instant notification to clients by email one by one not the entire list in a go.

    I would like to create an infopath form that submits an email based on the rich text and picks up the recipients list from the sharepoint form library (Clients) that has a field email address, and parses messages one by one till the whole list is complete. Reason of doing this one by one is since its an impt notification and i do not want it to be treated as junk or spam.

    Help!!.. thanks!

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