-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmembersSignupDemo.yaml
63 lines (57 loc) · 1.62 KB
/
membersSignupDemo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Execute every time a purchase is update
name: membersSignup
eventName: members.signup
route: created
# true by default, but here you can see you're able to disable them just adding this key.
enabled: true
actions:
# Print everything to the log
- name: print-log
type: log
# Getting account info
- name: getMetaInfo
type: http
options:
url: http://your-awesome-endpoint.io/{{ member.account }}
method: GET
merge: true
mergeTarget: _account
- name: templateAmountField
type: template
options:
fields:
test: '{{ amount/100 }}'
# Copy all contents to vars to be used in email
- name: copyAllToVars
type: mapper
options:
copy:
- vars
# Merge email configuration
- name: mergeTransportSettings
type: merger
options:
sourceFields:
- vars._account.meta.emailConfig
- vars.privateMeta.emailConfig
targetField: vars._email
# Convert event to email
- name: mapEmailFields
# Type mapper gets the previous action result and converts its fields to a new object with the specified structure.
type: mapper
options:
fields:
vars.member.email: to
vars._email.transport: transport
vars._email.template: template
vars._email.subject: subject
vars._email.apikey: apikey
vars._email.from: from
# map every other var in the scope to `vars`, so the mail template has access to them.
'*': vars
# Send members to emails queue applying
- name: sendSignupConfirmationEmail
type: prev2task
options:
target: emails
targetRoute: email.send