{"id":7550780,"url":"https://github.com/DryDumbHead/easyHtmlEmail","last_synced_at":"2025-05-13T03:31:34.663Z","repository":{"id":232107192,"uuid":"411815450","full_name":"DryDumbHead/easyHtmlEmail","owner":"DryDumbHead","description":"Easy to Generate \u0026 Maintain Email in SAP (ABAP + HTML/CSS)","archived":false,"fork":false,"pushed_at":"2022-05-27T19:25:58.000Z","size":169,"stargazers_count":28,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T22:01:31.956Z","etag":null,"topics":["abap","easy-email","email","email-template","html-template","sap"],"latest_commit_sha":null,"homepage":"","language":"ABAP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DryDumbHead.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-29T20:09:22.000Z","updated_at":"2025-04-01T11:17:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba10cd33-ad8d-4863-8d4f-bfecd00d456f","html_url":"https://github.com/DryDumbHead/easyHtmlEmail","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"e8b1bbf78fdceb20dc8db598508303d016275c0c"},"previous_names":["drydumbhead/easyhtmlemail"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DryDumbHead%2FeasyHtmlEmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DryDumbHead%2FeasyHtmlEmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DryDumbHead%2FeasyHtmlEmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DryDumbHead%2FeasyHtmlEmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DryDumbHead","download_url":"https://codeload.github.com/DryDumbHead/easyHtmlEmail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253867687,"owners_count":21976272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","easy-email","email","email-template","html-template","sap"],"created_at":"2024-04-08T01:06:20.710Z","updated_at":"2025-05-13T03:31:34.336Z","avatar_url":"https://github.com/DryDumbHead.png","language":"ABAP","funding_links":[],"categories":["Categories"],"sub_categories":["🗒️ eMail \u0026 Document Processing"],"readme":"# easyHtmlEmail\n### *Easy to Genrate \u0026 Maintain Email in SAP (ABAP + HTML/CSS)*\n\n---\n\nGenerating \u0026 Maintaing E-mail through ABAP is always dirty code while buildling email body with text-elements/message class.  \nEven simple plain text Email results in lots of irrelevant code in ABAP, so generating modern e-mails (HTML/CSS/images) in abap can be a nightmare for anyone.\n\n***easyHtmlEmail*** provides a helper class `Zcl_easy_email` which helps the ABAP developer to consume HTML template to build email.  \nThe static part of email will no longer be handled by ABAP code, developer only need to worry about dynamic values in email.  \n[easyHtmlEmail Blog Post](https://blogs.sap.com/2021/10/04/easy-to-generate-maintain-email-abap-html-templates-easyhtmlemail)\n\n\u003e Note: `Zcl_easy_email` is Built on Top of Function Module `WWW_HTML_MERGER`, so Pros \u0026 Cons are inherited. Refer [WWW_HTML_MERGER](https://help.sap.com/saphelp_autoid2007/helpdata/en/2b/d921034b8a11d1894c0000e8323c4f/content.htm?no_cache=true)\n\n---\n\n## Features:\n\n- Build Modern e-mails\n- Static \u0026 dynamic content segregation\n- Pesentation \u0026 logic segregation\n- Avoid irrelevent ABAP code resulting clean code.\n- Easy maintainace \u0026 translation of emails\n- Resueability\n- Easy Combining of master \u0026 child email templates\n\n---\n## Changes:  \n[CHANGELOG.md](CHANGELOG.md)\n## Steps:\n1. Build email Template and upload in T-code `SMW0`.  \n    ![Templates in SMW0](assests/img/SMW0.jpg)  \n    Template must contain Placeholders for dynamic values (highlighted in yellow are placeholders).  \n    ![Master template](assests/img/Master_html.jpg)\n    ![Child template](assests/img/Child_html.jpg)  \n\u003e Demo HTML templates is taken from [BBBootstrap public e-mail templates](https://bbbootstrap.com/snippets/order-confirmation-email-template-19073214)  \n\n\n1. Maintain config in Table `ZMAIL_TEMP_CONF`.(Optional)\n   \n2. Create instance of `Zcl_easy_email` and set template.  \n            \n            DATA : go_EASY_EMAIL TYPE REF TO ZCL_EASY_EMAIL.\n            CREATE OBJECT go_EASY_EMAIL .\n            \n            go_EASY_EMAIL-\u003eset_subject(\n                title = 'mail subject '\n                ).\n\n            go_EASY_EMAIL-\u003eset_template(\n                p_template       = 'ZTESTEMAIL' \n                p_mastertemplate = 'ZTESTEMAILMASTER'\n                ).\n            \n3. Pass in Placeholder \u0026 dynamic value pairs.  \n\n            go_EASY_EMAIL-\u003ereplace_placeholder(\n                EXPORTING\n                placeholder_name = '!VBELN!'\n                replacement_type = 'R'          \"replace placeholder with single value\n                single_value     = ' 23412 '\n            ).\n\n            go_EASY_EMAIL-\u003ereplace_placeholder(\n            EXPORTING\n                placeholder_name = '!PRICE!'\n                replacement_type = 'R'          \"replace placeholder with single value\n                single_value     = ' 1234.90\n            ).\n\n            data : multi_line TYPE soli_tab,\n                   line TYPE soli.\n            line = 'LINE 1 : LINE1 \u003c/br\u003e'.\n            APPEND LINE to multi_line.\n            line = 'LINE 2 : LINE2 \u003c/br\u003e'.\n            APPEND LINE to multi_line.\n            \n            go_EASY_EMAIL-\u003ereplace_placeholder(\n            EXPORTING\n                placeholder_name = '!LOG!'\n                replacement_type = ' '          \"replace placeholder with multiple Lines\n                multi_line       =  multi_line\n            ).\n\n4. Build email , add recipients, send the mail\n\n            go_EASY_EMAIL-\u003eadd_email( email = p_email ).\n            go_EASY_EMAIL-\u003ebuild_body( ).\n            go_EASY_EMAIL-\u003esend_mail( 'X' ).\n\n5. E-mail visible in SOST  \n   ![Final Modern Email in SOST](assests/img/Final_Mail_in_SOST.jpg)\n\n\u003e Report `zeasy_email_demo` demonstrate the usage of class `Zcl_easy_email`.  \n\n---\n\n## Limitations:\n- Number of Character in each line in HTML template \u003c= 255  \n- Special care of text encoding required for HTML template. For BASIS 701 templates where stored in ISO-8859-2 encoding (code page 1401), so HTML template must be developed and maintained with ISO-8859-2 encoding. Incorrect encoding may result in unexpected results.  \n\n\u003e This solution is helpful for non-S/4 system  \n\u003e SAP has introduces much better solution E-MAIL templates + CDS view in S/4 systems [more info](https://blogs.sap.com/2019/10/12/e-mail-templates-in-s4-hana/).\n\n---\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDryDumbHead%2FeasyHtmlEmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDryDumbHead%2FeasyHtmlEmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDryDumbHead%2FeasyHtmlEmail/lists"}