The SAS Output Delivery System and reporting techniques

Embed Pushbotton and Textbox in the outlook email generated by SAS

Reply
New Contributor
Posts: 2

Embed Pushbotton and Textbox in the outlook email generated by SAS

I have the below code

 

%let to = name@email.com;  

 %let name = name;  

 %let report = Daily Status Report; 

  filename mymail email "&to"    

  type = "TEXT/HTML"    

  subject = "Report Status";

   

 

  data _null_;     

  file mymail;       

  put '<html><head>';      

  put '<style type="text/HTML" MEDIA=screen><!--'; 

  put 'body { color: #346170; font-family: Verdana; font-size: 10pt; }';      

  put '.errorMessage { color: Red; font-size: 8pt; }';      

  put '--></style></head><body>';      

  put 'name -<br /> The following reports are complete:';      

  put '<ul><li>Daily Status Report</li>';  

  put '<button type="button" >ACCEPT!</button>'; /* this two lines I have added but didn't work*/

  put '<button type="button">REJECT!</button>';

  put '</body></html>';   

  run;

 

I have attached the screenshot of the email as needed.

Super User
Posts: 13,947

Re: Embed Pushbotton and Textbox in the outlook email generated by SAS

Please describe what "didn't work" actually means.

 

Was there an error in the code? If so copy and paste the code and error message(s) from the log into a code box opened using the forum's {I} icon.

Was the email not generated?

Was the email generated but the push buttons didn't appear?

Was the email generate and the push buttons appeared but nothing happens when pushed?

Or something else?

 

 

New Contributor
Posts: 2

Re: Embed Pushbotton and Textbox in the outlook email generated by SAS

Q)Was there an error in the code? If so copy and paste the code and error message(s) from the log into a code box opened using the forum's {I} icon.

A) There is no error in the code, But in the outlook email the Push button showing as a plain text.

 

Q) Was the email not generated?

A) Yes email generated succesfully

 

Q)Was the email generated but the push buttons didn't appear?

A) Yes, Push button appearing as a plain text

 

Q)Was the email generate and the push buttons appeared but nothing happens when pushed?

Or something else?

A) Yes email generated and push button appeared as a plain text.

SAS Super FREQ
Posts: 9,434

Re: Embed Pushbotton and Textbox in the outlook email generated by SAS

Hi:

  I notice that you don't have content-type="text/html" as shown on the 10-24-2017 entry in this forum post:

https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-format-text-in-SAS-email-body-bulk-e-ma...

 

  Notice how the content-type is provided on the FILENAME statement. Other things to check -- did your EMAIL system convert the HTML to plain text? Check with your mail administrators. Without a clear content-type for the mail, they may have converted everything.  Some mail systems strip active links and scripts out of mails to prevent malware - again, this is something you need to check at your end of things.

 

  You said that mail was generated successfully. Outside of the mail environment, have you tested whether your HTML page will work when viewed in a browser? I am not completely current on HTML and CSS, but having text/html in the <style> tag may not be enough for your mail system and usually, when I see a <button> tag, there is some kind of "action" or HREF= to "do" something when the button is clicked, as shown here: https://www.copernica.com/en/blog/post/how-to-create-email-buttons-with-just-html-and-css .

 

  The W3Schools site: https://www.w3schools.com/tags/tag_button.asp indicates there are new features for <button> in HTML5 vs HTML4, but since you don't have a <DOCTYPE> tag, you don't tell the mail system what kind of HTML you're sending. Also, the W3Schools site only shows browser support for <BUTTON> so you might want to check with your mail administrators to see whether <BUTTON> in mail is supported by the system you're using for email.

 

  Just a few other suggestions for debugging,

Cynthia

Ask a Question
Discussion stats
  • 3 replies
  • 208 views
  • 0 likes
  • 3 in conversation