{"repo":"vidyadharg/ABAP-HTML-eMail","free":true,"listed":false,"github":"https://github.com/vidyadharg/ABAP-HTML-eMail","clone":"git clone https://github.com/vidyadharg/ABAP-HTML-eMail.git","description":"SAP ABAP send email using eMail Templates with or without CDS","language":"ABAP","stars":14,"topics":["cl-smtg-email-api","smtg-wb-start","abap-html-email","email-templates"],"license":"GPL-3.0","category":"auth-billing-email","readme_excerpt":"SAP ABAP send email using eMail Templates with or without CDS 1. Create E-Mail Template 2. Create class ZCL EMAIL inheriting from CL BCS MESSAGE 2.1. METHODS SET BODY SO10 \" get Email body from so10 text. 2.2. METHODS SET PLACEHOLDER \" set dynamic variable to be replaced in email to body 2.3. METHODS replace placeholder \" replace placehoder for non cds email template 2.4. METHODS SET PLACEHOLDER ITAB \" replace Itab placehoder for non cds email template 2.5. METHODS SET SUB BODY TEMPLATE \"read email body from email template \"2.5.1. Dont pass place holders when Email teplate created without CDS. SELECT SINGLE cds view FROM smtg tmpl hdr INTO @DATA(lv cds view) WHERE id EQ @iv template id AND version EQ 'A'. \"GC VERSION ACTIVE IF sy-subrc EQ 0. IF lv cds view IS NOT INITIAL. DATA(lt data key) = gt data key. ENDIF. \"2.5.2. Read email template in HTML or Text. TRY. DATA(lo email api) = cl smtg email api= get instance( iv template id = iv template id ). lo email api- render( EXPORTING iv language = iv lang it data key = lt data key IMPORTING ev subject = DATA(lv subject) ev body html = DATA(lv body html) ev body text = DATA(lv body text) ). CATCH cx smtg email common INTO DATA(ex). \" E-Mail API Exceptions ENDTRY. \"2.5.3. Replace placehoder for non-cds email template IF iv doctype EQ 'HTM'. DATA(lv mailbody) = lv body html. ELSE. lv mailbody = lv body text. ENDIF. IF lv cds view IS INITIAL. lv mailbody = replace placeholder( lv mailbody ). lv subject = replace placeholder( lv subjec","default_branch":null,"files":null,"tree":[],"storefront":"/r/vidyadharg","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vidyadharg/ABAP-HTML-eMail/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}