<?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>question Re: NiFi - is it possible to send an email with attachment to a variable list of recipients? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192832#M154896</link>
    <description>&lt;P&gt;Thank you! I knew there had to be simple answer - I used the first method and it worked great! Thanks again for your help.&lt;/P&gt;</description>
    <pubDate>Fri, 18 May 2018 00:03:03 GMT</pubDate>
    <dc:creator>khenrie</dc:creator>
    <dc:date>2018-05-18T00:03:03Z</dc:date>
    <item>
      <title>NiFi - is it possible to send an email with attachment to a variable list of recipients?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192830#M154894</link>
      <description>&lt;P&gt;I have a business case where the user wants to send a personalized email to a group of recipients and attach a PDF to the email. &lt;/P&gt;&lt;P&gt;I already had a working flow for him that took the list of emails and recipient names in a csv file, parsed those out row-by-row, converted to json, evaluated the json to assign values to attributes, and then send the email (see image), but I'm having trouble with the attachment part since the PDF isn't part of the flowfile.&lt;/P&gt;&lt;P&gt;Is there a way to pull the PDF into NiFi and assign the attributes needed from perhaps a map file or something? or replace the flowfile with the PDF and maintain the attributes? Once the attributes are assigned, I don't need the .csv data anymore.&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="72882-screen-shot-2018-05-16-at-50131-pm.png" style="width: 1874px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18247i52ECACF3FCE4AE3B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="72882-screen-shot-2018-05-16-at-50131-pm.png" alt="72882-screen-shot-2018-05-16-at-50131-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:05:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192830#M154894</guid>
      <dc:creator>khenrie</dc:creator>
      <dc:date>2019-08-18T07:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - is it possible to send an email with attachment to a variable list of recipients?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192831#M154895</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/65221/khenrie.html" nodeid="65221" target="_blank"&gt;@K Henrie&lt;/A&gt;&lt;P&gt;If the PDF file path don't change then you can use &lt;STRONG&gt;UpdateAttribute &lt;/STRONG&gt;processor after &lt;STRONG&gt;EvaluateJsonPath &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;add new properties in update attribute processor.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="74456-updateattr.png" style="width: 1797px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18245i65A17346C5D963F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="74456-updateattr.png" alt="74456-updateattr.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then use &lt;STRONG&gt;Fetch File processor&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="74457-fetchfile.png" style="width: 1453px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18246i29BB13BEB1D4B4E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="74457-fetchfile.png" alt="74457-fetchfile.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;to fetch pdf file for every receipt then use&lt;STRONG&gt; PutEmail processor &lt;/STRONG&gt;to send the attached pdf file and include all the attributes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Flow:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;--other processors--1.EvaluateJsonPath Processor //extract values as attributes2.UpdateAttribute Processor //add directory,filename attributes to the flowfiles3.FetchFile Processor //to fetch the PDF file now we are overwriting the contents of flowfile,attributes will be same there4.PutEmail&lt;/PRE&gt;&lt;P&gt;By using this way we are fetching the pdf file for every email receipt.&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Keep your pdf file into Distribute Cache map server using PutDistributedMapCache processor with some id and configure/enable DistributedMapCacheClientService,&lt;STRONG&gt;DistributedMapCacheServer &lt;/STRONG&gt;controller services.&lt;/P&gt;&lt;P&gt;then use the same &lt;STRONG&gt;DistributedMapCacheClientService&lt;/STRONG&gt; Controller server in &lt;STRONG&gt;FetchDistributedMapCache processor&lt;/STRONG&gt; with the same id that specified while keeping the pdf file in PutDistributeMapCache to fetch the file from the Distributecache server.&lt;/P&gt;&lt;P&gt;By following this way we are not fetching the file from local directory instead we are loading into NiFi and pulling from the DistributedCache.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow1:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Put pdf file into DistributedMapCache:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.GetFile //get the file from directory (or) you can use Listfile/FetchFile processors also
2.UpdateAttribute //add the Cache Entry Identifier key and value
3.PutDistribuedMapCache //put the pdf file into DistributedMapCache&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow2:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Actual Flow to send mail with pdf file attached:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;--other processors--1.EvaluateJsonPath 2.UpdateAttribute //add the Cache Entry Identifier key and value3.FetchDistributedCacheMap //to fetch the pdf file4.PutEmail
&lt;/PRE&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer addressed your question, &lt;STRONG&gt;Click on Accept button below to accept the answer, &lt;/STRONG&gt;That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:05:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192831#M154895</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T07:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - is it possible to send an email with attachment to a variable list of recipients?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192832#M154896</link>
      <description>&lt;P&gt;Thank you! I knew there had to be simple answer - I used the first method and it worked great! Thanks again for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 00:03:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/192832#M154896</guid>
      <dc:creator>khenrie</dc:creator>
      <dc:date>2018-05-18T00:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - is it possible to send an email with attachment to a variable list of recipients?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/311401#M224633</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/55311"&gt;@Shu_ashu&lt;/a&gt;&amp;nbsp; How to configure the flow if&amp;nbsp; EvaluateJsonPath Processor flow have recipient mail id and&amp;nbsp;FetchFile has the file path. I have configured as below but two mails are getting triggered. Could you help to modify the flow so that only one mail with attachment will trigger ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aaki_08_0-1613109355117.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30391iBF1D766DBF40C135/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aaki_08_0-1613109355117.png" alt="Aaki_08_0-1613109355117.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aaki_08_1-1613109616577.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/30392i03AB4EC41DB41141/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aaki_08_1-1613109616577.png" alt="Aaki_08_1-1613109616577.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 06:00:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-is-it-possible-to-send-an-email-with-attachment-to-a/m-p/311401#M224633</guid>
      <dc:creator>Aaki_08</dc:creator>
      <dc:date>2021-02-12T06:00:44Z</dc:date>
    </item>
  </channel>
</rss>

