Method Community

 

Attach a Document in The DocumentLibrary Table to an Email

Last post 08-19-2015 8:55 AM by Method_Morty. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-14-2015 1:33 PM

    Attach a Document in The DocumentLibrary Table to an Email

    Hello,

    I am able to generate a report silently and email it as an attachment without an issues. Is there a way to attach a document that is stored in the DocumentLibrary table to an email. I have tried adding a few different fields to the attachment location option in the send email action, but none of them have pulled in the document. Any ideas?

    --Aaron 

  • 08-17-2015 12:52 PM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    Hey Aaron,

    Please take a look at THIS thread and follow up with any further questions on this thread.

    - Mortaza

    Morty Barighzaai
    Customer Success Manager
    Method:CRM
  • 08-17-2015 3:15 PM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    OK, I got it to work as described in the thread you referenced. However, It will only allow one file to be uploaded as an attachment. Is there a way to add more than one? This is important when emaileding out multiple estimates to customers.

    --Aaron

  • 08-18-2015 9:28 AM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    Hey Aaron,

    You definitely can, in the Send Email action you can click the plus sign beside the Attachment Location field to add more attachments.

    It's hard to see here is a screenshot:

    - Mortaza

    Morty Barighzaai
    Customer Success Manager
    Method:CRM
  • 08-18-2015 9:51 AM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    That is not what I am asking. I am asking if you can attach multiple files to an email by storing them in aone action result and sending that one action result to the "Attachment Laocation" option of the "Send Email" action. For example, let's say I have a grid with 5 different estimates associated with a particular opportunity. The grid is added to the screen with the first column being a check box. The user may then select which of these 5 estimates to attach to an outgoing email activity via a customized CRM_NewActivity screen. Ideally I would loop through only checked records in the grid, generate the associated estimates and store those into a single action result to pass to the "Send Email" action. Without this ability I have to first get a count of the rows checked and then have 5 different conditional statement actions to deal with each of the count possibilities (1 to 5). I would them have to generate one report in the first conditional statement, two in the second, three in the third etc. I would then have to call a "Send Email" action at the end of each conditional statement and manually define the attachments as the generated report action results previously stored in the conditional statement. This seems like complete coding craziness to me.

    --Aaron

  • 08-18-2015 3:56 PM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    Hey Aaron,

    I understand your question now. You want to be able to have an array of attachments in one action result. So you don't have to hard code how many attachments there will be and it automates on the fly.

    This should be possible as well.

    I would start by heading over to the Invoices screen and take a look at the Button under the Grid for Print > Print Selected. 

    Look at the Action Set. Give the Generate Report Action an Action Result name and use it on a Send Email Action to test. Following this Action Set you can use it across screens.

    Is this what you were trying to accomplish Aaron?

    - Mortaza

    Morty Barighzaai
    Customer Success Manager
    Method:CRM
  • 08-19-2015 7:09 AM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    Mortaza,

    Prior to receiving your reply I actually coded a solution the hard way which works well. I also tested the approach you suggested above and it too works, but works slightly different. When doing it my way, the PDF reports are individually generated and attached as separate files to the sent email. Doing it the way described by you above (i.e sending an array to the "Generate Report" action) generates one PDF file with multiple individual estimates within it. There are pros and cons to both ways in my opinion. My solution allows the customer to save/print/email only the quote that they are considering taking action on while the array way does not. However, my way took about 50 lines of code to produce the email with attachments and the array way takes only 3. Also, my way is limited to only being able to attach 5 estimates to an email due to the limitation on number of file attachments allowed where the array way could dynamically email any number of estimates bcause only one file is attached to the email. I suppose I will have to pick my favorite flavor.

    Thanks for all the help so far. You have been great.

    --Aaron

  • 08-19-2015 8:55 AM In reply to

    Re: Attach a Document in The DocumentLibrary Table to an Email

    Hey Aaron,

    That's great to hear! The pros/cons for both routes do make sense. In terms of sending out Estimates I feel like the approach you have taken in my opinion is better. As you stated, giving your Customers an option to print only the Estimate they want is more user friendly.

    Appreciate the follow up.

    - Mortaza

    Morty Barighzaai
    Customer Success Manager
    Method:CRM
Page 1 of 1 (8 items)