Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Email Tool sending endless emails? How to send an email to only one recipient.

CristonS
Alteryx Alumni (Retired)
Created

The Email tool is designed to send an email for each record that you input -- if you attach an Email tool directly to your output data stream, it will generate and send one email per record – e.g.: if you have one thousand records in a report you'd like to send, the Email tool will send one thousand emails.

 

The reason for this is that you may have a list of email addresses as recipients, or you might want to use a separate subject line for each department in your organization; that is what the input side is for – to allow you to dynamically populate fields such as the "To" and "From" fields, or even the body of the email itself.

 

text input email tool.JPG

 

If you're not populating your Email tool from your data stream, to keep the Email tool from sending a thousand emails, first separate a single record from your data stream, attach the email tool to that single record, and then hard code your configuration – including attachment -- into the Email tool. There are a lot of ways to accomplish this - a Sample tool, or a Select Records tool, or a Unique tool will all get the job done.


The Email tool will execute at the end of the module, regardless of what is attached to it. Based on this, once you've written out your results using an Output tool, another option is to simply attach an Email tool to a Text Input anywhere in your workflow and hard code your configuration into the Email tool with the attachment specified – just don't put more than one record in your text input!

 

email config.JPG

 

Comments
JPLynch
5 - Atom

Great tip, Thanks!

aMac
8 - Asteroid

 I am still confused-- how can I attach the new output of each scheduled run of this Alteryx workflow?

 

For example, I have a filter tool that redirects records meeting the criteria into a 'Data Output' tool that is set to output to a specific folder.

How do I instruct the Email tool to 'suck in' that Data output and send as an Email attachment?

 

I have been googling this everywhere with no success.

 

EDIT: I re-read this link, and it looks like my only option here is to overwrite the same Error log upon each workflow run and hardcode the (pending) file's location into a the input stream.

I tested this and it seems to be working.

mbarone
16 - Nebula
16 - Nebula

If I understand you correctly, you're trying to do something like I do.  I have a bunch of records that need to go to certain branches, in the form of a spreadsheet.

 

At the end of my processing, I wind up with each of my records having the following four additional fields:  Email_To, Email_Subj, Output_Full_Path, and Email_Att_Loc:

Shot1.jpg

That way each record gets sent to a particular spreadsheet via the output tool using the Output_Full_Path field.  I use a the first node of a Block-Until-Done tool just before the output tool.

 

Then, I send the second node of the same Block-Until-Done tool to a Summarize tool and I group by Email_To, Email_Subj, and Email_Att_Loc:

Shot2.jpg

I now have one record and one attachment for each email address.  This can now go into an Email tool.

 

I configure the Email tool like this:

Shot3.jpg

 

You can modify these steps to suit your needs, but I think this will give a good idea of how to do what you want to do, and how to do it dynamically instead of hard-coding.

 

 

aMac
8 - Asteroid

Thanks @mbarone! I actually did some testing earlier and was able to work a solution that worked for the project's requirements.