Solved

Emailer - how to send fanout outputs in a single email

  • 20 March 2023
  • 4 replies
  • 10 views

I have a workbench intended to run daily on FME Server. It does the usual data transformation stuff and then it email reports to a member of staff once per week.

 

The report contains information relating to contractor performance over a 30 day period. I only want to send out a report if there's in new activity in the past 30 days.

 

Currently, I have 9 x reports (one for each contractor). The reports are updated daily.

 

I want the Emailer transformer to email only those reports containing new activity. I have gotten as far as calculating which reports are valid (i.e. within 30days) and using an Attribute Creator to fanout a new attribute, being the path & filename of the report. The Emailer then reads the fanout parameter as the Source File, picks it up and sends it. The problem is, the Emailer is sending each attachment in individual emails. I want the transformer to recognise which reports are valid and then send them together in a single email.

 

The image I have attached shows 5 x outputs, being the valid reports. I want the Emailer to read the path & filename associated and then email them in one email. Can this be done? Thanks in advance.

icon

Best answer by virtualcitymatt 20 March 2023, 08:42

View original

4 replies

Userlevel 4
Badge +26

Area you able to zip the relevant reports together? that would make it easy. One feature will send one email so you need to have just one feature hitting the emailer. For each attachment you need to create a new entry in the attachments form....not so easy when the number of attachments can change.

 

In the past what I have down to work around this is to have one emailer for each possible number of attachments...so four you I guess it would be 9. Each one has some number of attachments configured (from 1 - 9)....its ugly and not really a proper solution but it was what worked for me if you need a quick fix.

 

Zipping and sending one is a better solution but then you have to send a zip which is not ideal for the contractor at the end.

 

Perhaps there's a way to specify a dynamic number of attachments - perhaps @nampreetatsafe​ can let us know if there is.

 

Userlevel 4
Badge +26

Area you able to zip the relevant reports together? that would make it easy. One feature will send one email so you need to have just one feature hitting the emailer. For each attachment you need to create a new entry in the attachments form....not so easy when the number of attachments can change.

 

In the past what I have down to work around this is to have one emailer for each possible number of attachments...so four you I guess it would be 9. Each one has some number of attachments configured (from 1 - 9)....its ugly and not really a proper solution but it was what worked for me if you need a quick fix.

 

Zipping and sending one is a better solution but then you have to send a zip which is not ideal for the contractor at the end.

 

Perhaps there's a way to specify a dynamic number of attachments - perhaps @nampreetatsafe​ can let us know if there is.

 

Oh, looks like I created an idea a while ago about this very thing: https://community.safe.com/s/bridea/a0r4Q00000HbrAAQAZ/emailer-unknown-amount-of-attachments - you should vote on it.

Oh, looks like I created an idea a while ago about this very thing: https://community.safe.com/s/bridea/a0r4Q00000HbrAAQAZ/emailer-unknown-amount-of-attachments - you should vote on it.

Done!

Area you able to zip the relevant reports together? that would make it easy. One feature will send one email so you need to have just one feature hitting the emailer. For each attachment you need to create a new entry in the attachments form....not so easy when the number of attachments can change.

 

In the past what I have down to work around this is to have one emailer for each possible number of attachments...so four you I guess it would be 9. Each one has some number of attachments configured (from 1 - 9)....its ugly and not really a proper solution but it was what worked for me if you need a quick fix.

 

Zipping and sending one is a better solution but then you have to send a zip which is not ideal for the contractor at the end.

 

Perhaps there's a way to specify a dynamic number of attachments - perhaps @nampreetatsafe​ can let us know if there is.

 

Thanks Matt, I didn't think about zipping the attachments. It will do the trick for now and allow me to get this wb published :)

Reply