BookmarkSubscribeRSS Feed
wellsfargo123
Fluorite | Level 6

Hi,

SAS program send an email with attached report file, the expected action by the recipient is to review the attached files and approve/reject the report by clicking the link embedded in the message body.

How this can be done ?

The part to send the email recipient is in place and is working fine. 

How to check and track whether they have approved the report by clicking the link in the message body?

Once approved, the email has to be moved to another folder.

Can this be done using SAS  ?

 

Thanks,

Elizabeth

7 REPLIES 7
Quentin
Super User

I would work on figuring out first whether SAS can generate an email with an accept/reject button.  

 

After that, I would think the rest you would want to automate in Outlook, with rules or some outer microsoft automation approach. I wouldn't use SAS for that part of triggering an action based on the accept/reject response.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
wellsfargo123
Fluorite | Level 6

Is there an existing sample sas code which I can use ?

Quentin
Super User

Here's a good article:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-send-email-using-SAS/ta-p/746523

 

In the comments, Chris Hemedinger mentions that voting buttons are not part of the SMTP standard, they're an outlook thing. So you can't generate them from SAS.  But you could use a link to implement your own voting. 

 

I haven't done this sort of automation, but I would look from the Microsoft automation side.  Whether that means Outlook automation via simple outlook rules, or ms flow / power automate, or something like that.  Perhaps your email admin could help develop a solution.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
Sajid01
Meteorite | Level 14

Hello @wellsfargo123 
This is my analysis of your issue.

The process you are envisaging is a two  step one.
 Step 1: SAS program sends an email. Obviously, this is a SAS step.
 Step 2: The user responds with Yes/No option selected. The user is using an email client with html support for example Outlook, Thunderbird so on.
               Rare exceptions aside I don't see   SAS   involved in this. This is an HTML /HTML-JavaScript process.
              We can however program SAS to generate / write this code as a part of the email.
              If html support in the users email client is disabled OR not available, then button won't work.
 
Now when designing your email content that SAS would send one needs to consider the following steps:
 
 Step 1: Prepare an HTML / HTML-JavaScript portion   of the email the recipient is going to receive. Test the button.
         Internet search may get you code fragments that you can assemble and test OR you can seek help from WEB/Full Stack developers.
 Step 2: Append the above content to your email that SAS is going to send.
 
 
Quentin
Super User

SAS is good at generating reports, and in this case the report is an attachment, so that might make this easier to automate.  Maybe:

 

  1. SAS generates a report, and emails it to you (SAS programmer) with a standard subject line and attachment.
  2. You have a Outlook rule (or whatever email automation) that says "when an email is received from this sender with this subject and an attachment, send a new email to my boss with  text 'please approve' in the email body and a voting button and the attachment."
  3. Then when you get a voting response, you can have another to respond.

So you let SAS generate the report, and send an email that provides the report and triggers an automated process that is managed outside of SAS.

 

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
wellsfargo123
Fluorite | Level 6

For sending the email we are planning to use SAS.   Once we receive the response email (Y/N) , i was thinking of developing a program to move that email with specific subject to another folder using sas. From what I understand the only possible option is to use rules in MS outlook. Still researching for best options.

Sajid01
Meteorite | Level 14

@wellsfargo123 
You can consider using a VBA script. 
A SAS  program can call this VBA script or it can be run using a scheduler according to the required schedule..

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1036 views
  • 0 likes
  • 3 in conversation