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 is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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 is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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 is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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