Skip to main content

SendMail with Attachments

Comments

13 comments

  • Ryan Cooney

    Hi Ralph,

    This is possible.

    You can use an Assign activity to create the correct collection type instead of CreateCollection<T>. This would be the expression on the right hand side of the Assign.

    New System.Collections.ObjectModel.Collection(Of System.Net.Mail.Attachment)

    After that you can use the AddToCollection<T> activity to add your Attachment objects to it. This works because System.Collections.ObjectModel.Collection<T> is an ICollection<T>.

    --Ryan

    0
  • Permanently deleted user

    Hi Ryan

    that is excellent news I was half way there as far as creating the new collection via the Assign but hadn't twigged that I could still use the Add to Collection Activity.

    Unfortunately I am now getting a Workflow Designer NotImplementedException when I try to Design a Form in my workflow. This is since upgrading to GE3.10

    So starting a new thread...

    Thanks very much

    Ralph Price

     

    0
  • Permanently deleted user

    You can use an Assign activity to create the correct collection type instead of CreateCollection<T>. This would be the expression on the right hand side of the Assign.

    New System.Collections.ObjectModel.Collection(Of System.Net.Mail.Attachment)

    After that you can use the AddToCollection<T> activity to add your Attachment objects to it. This works because System.Collections.ObjectModel.Collection<T> is an ICollection<T>.

     

    I have successfully created the system.collections.objectmodel.collection(of systsem.net.mail.attachment).

    I have the path and name of a .pdf file generated by the printmap activity. I am having trouble adding that pdf file path and name to the collection.  Can you provide  sample syntax for this?  The idea of the workflow is to create a printmap image of the screen and email it to our editors.  So far, i can create the screen print map, create the email forms etc, but i need to know how to create a mail attachment for the output of the printmap.

     

    Jeff

    0
  • Permanently deleted user

    Hi Jeff,

    I have enclosed (https://data.latitudegeo.com/community/findparcelsnearschools_AS.zip) here a modified version of sample workflow from "(https://support.geocortex.com/essentialsGSCCodeGallery?id=kA4600000004EX3) Find parcels near schools " that will send emails with attached reports. The workflow is designed to work with the Charlotte Bing sample site. Please note you will have to configure the SMTP settings to match your environment.

    Hope this helps,

    --Alejandro

    0
  • Permanently deleted user

    Thank you, Alejandro! With your example, I was able to adapt the workflow to export a map image (jpg) from my HTML5 viewer and attach it in an email. It doesn't work in IE8, but this is primarily directed at tablets & phones.

    0
  • Permanently deleted user

    Hi Heather,

      IE 8 isn't a very capable HTML5 browser; it only scores 42 points out of 500 - see http://html5test.com/compare/browser/ie08.html

    regards,

    Edmond

     

     

    0
  • Carmen Durham

    Alejandro's modified version helped me immensely, also, in providing a tool to allow the user to email a map image or a print template .pdf.

    Thank you!

    Carmen

    0
  • Permanently deleted user

    I'm having problems with the attachment.

    It appears the E-mail activity needs to be in the same scope as the activities for creating the attachment. I cannot figure out why this is.

    0
  • Permanently deleted user

    What kind of problem you met?

    If that problem is related with the searialzation error', recommend to watch few videos relating with workflow from the Geocortex User Conference 2013 like "(https://support.geocortex.com/essentialsGSCVideo?sub-nav=videos&main-nav=essentials&feedtype=SINGLE_ARTICLE_SEARCH_RESULT&id=kA560000000Canl) Deep Dive: Workflow I, II, & III " (see the second video) to understand the Scope.

    Check if there is any client activity like 'alert' etc in between the scope where the attachment is created, and the scope where Send Mail activity is located. If then, that may be the culprit since it tries to pass non-serializable values back-and forth between client and the server.

    0
  • Permanently deleted user

    Hi Everyone,

    I'm trying to also setup my workflow to email the user a PDF of the map, however the map is being created using the PrintMap tool instead of the Report tool.

    The resulting URL takes you to another webpage that says :

    Geocortex Essentials

    Print Status

    The print job is finished.

     

    Download 

     

    How do I set up my workflow so the resulting URL does not take you to another page to "Download" the map, but opens it upon first click?

    Right now it's setup to email a person the URL of the map, however i'd like for it to email them a copy of the PDF for records purposes.

    Any help would be really appreciated.

    Thank You!

    Laura

    0
  • Permanently deleted user

    Hi Laura,

    Try disabling  Large-Format Printing for that specific print template. That will provide you with a direct download URL to the printed map PDF. For more information, please refer to section "31.6 Large-Format Printing" of Geocortex Essentials Admin Guide.

    --Alejandro

    0
  • Frank Martin
    Just wondering if anyone still has access to Alejandro's version of sample workflow from http://support.geocortex.com/find-parcels-near-schools-workflow-from-html5-viewer-webinar that will send emails with attached reports.  The link is no longer valid.  I'm having trouble attaching a file to an email and need some help.

     

    Thanks,

     

    Frank
    0
  • Permanently deleted user
    Sorry about that! I've updated all the broken links in this thread and re-hosted the workflow Alejandro had previous provided (https://data.latitudegeo.com/community/findparcelsnearschools_AS.zip) here .
    0

Please sign in to leave a comment.