0.0.59 • Published 3 months ago

@ikhlasdotcom/email-templates v0.0.59

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 months ago

README

CNH Documentations

Build Using

Development

  • yarn dev
  • access localhost:3000

For different locale

  • LOCALE=ms yarn dev
  • access localhost:3000

Building a template

RULES to building the template

  • Use table for building the layout. DON'T use flex because it not supported
  • For using an image DON'T use SVG
  • Keep in mind, you are building Handlebars template. so, the compiled template will have mustache template system for passing content(locale and data) that CNH supported.
  • Use provided Handlebars helpers from CNH for processing the content
  • For responsive design can use class name prefix xs (max 425px) and sm (max 600px) for responsive breakpoint. see tailwind.config.js
<!-- In desktop h1 have bold font and device less than sm have normal font -->
<h1 class="sm:font-normal font-bold">
  Hello world
<h1>

Steps to building the template

  • Building a template can create another file in src/templates/umrah_refund.html.
  • Variable in template can be used as @{{fullName}} and for locale @{{locale.greeting}}.
  • Translations is stored in static API Google Sheet
    • to integrate translations with template, make sure variable locale_filename in template file (Front Matter) is the same as section in Google Sheet
  • Integrating test data can create a json file in src/data/umrah_refund.json.

Sending the template

Modify translations

Adding an image

Use ContentStack to attach an image

<img
  src="https://images.contentstack.io/v3/assets/blt2a130c768c36b9df/blt4ef85c6c17c1a956/62ba4a83e218a20f88dda8cd/ikhlas-umrah-logo.png"
  alt="logo"
  width="160"
  height="25"
/>

Commands

  • yarn build compile template files
  • LOCALE=en yarn preview dimas@airasia.com umrah_booking_paid preview registered template in CNH send into the email

Required gcloud login commands

These commands required gcloud login with access/permission manage Key Management Service (KMS). Here's how to login in gcloud-cli

# login using Google Account
$ gcloud auth login
# login using service account file
$ gcloud auth activate-service-account --key-file service-accounts/kms-sa.json

Then set project id

$ gcloud config set project airasia-ikhlas-dev
  • yarn template:register:dev Upload compiled files and translations into CNH server in DEV environment
  • yarn template:register:prd Upload compiled files and translations into CNH server in PRD environment
  • ./bin/kms dev|prd decrypt To decrypt encrypted service-accounts file
  • ./bin/kms dev|prd encrypt To encrypt service account as encrypted file

Production Checklist

  • pipelines for deploy-prd is completed
    • deploy-prd job is not printing failed template
  • when running command LOCALE=en yarn preview:prd dimas@airasia.com new_template_name is received the email. also sender is from no-reply@notification.ikhlas.com

Production Email Manual Trigger

  • Use case: if customer entered a wrong email information.
  • Make sure to change the template test data file with customer data from PRD.
  • To push email preview manually in PRD, can use this command and it will use no-reply@notification.ikhlas.com.
  • LOCALE=en yarn preview:prd {target_email} new_template_name

Publishing package

  • yarn publish then put new version in prompt
  • create new branch. i.e git checkout -b prod/v0.0.11
  • git push origin prod/v0.0.11 --tags
  • update @ikhlasdotcom/email-templates package in ikhlas-web-admin

Pull Request Format

Whenever you want to create an MR, on the description part, select the "Default Template" that is available there. It will generate the template for your MR.

Screenshot_2022-11-14_at_1.54.51_PM.

Pull Request Title Format

COMMIT KEYWORDS Description

Example: FIX IKHLAS-869 Showing incorrect Islamic date in the app (earlier by 1 day)

Commit Keywords

  • FEAT (new feature)
  • FIX (bug fix)
  • DOCS (changes to documentation)
  • STYLE (formatting, missing semi colons, etc; no code change)
  • REFACTOR (refactoring production code)
  • TEST (adding missing tests, refactoring tests; no production code change)
  • CHORE (updating grunt tasks etc; no production code change)
  • CLEAN (removing dead code)
  • WIP (work in progress for any FIX, FEAT, REFACTOR etc)
  • STAGING (release version, Eg: 1.0-alpha+build.1)
  • PREPROD (release version, Eg: 1.0-beta+build.1)
  • PROD (release version, Eg: 1.0)

If that PR contains more than one commit messages, please try to keep "Description" relevant to those commit messages. If that PR is for more than one JIRA card, please use comma "," to separate the number. Example: IKHLAS-849,IKHLAS-834.

For further info, you can check https://airasia.atlassian.net/wiki/spaces/AASET/pages/1988821047/Mobile+Code+Review+Guidelines

0.0.59

3 months ago

0.0.58

3 months ago

0.0.57

3 months ago

0.0.56

5 months ago

0.0.55

5 months ago

0.0.54

5 months ago

0.0.53

5 months ago

0.0.42

10 months ago

0.0.43

10 months ago

0.0.44

9 months ago

0.0.45

8 months ago

0.0.46

8 months ago

0.0.47

8 months ago

0.0.51

6 months ago

0.0.52

6 months ago

0.0.50

6 months ago

0.0.48

8 months ago

0.0.49

7 months ago

0.0.40

11 months ago

0.0.41

11 months ago

0.0.37

12 months ago

0.0.38

12 months ago

0.0.39

12 months ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

12 months ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.19

2 years ago

0.0.26

1 year ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.16

2 years ago

0.0.8

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago