This commit is contained in:
Ricardo Espinoza
2019-10-28 17:23:25 -04:00
parent 9d0d85875e
commit d029c0de17
2 changed files with 607 additions and 116 deletions

View File

@@ -26,7 +26,8 @@ export async function mandrillApiRequest(this: IHookFunctions | IExecuteFunction
uri: `https://${endpoint}${resource}${action}.json`,
body: data,
json: true
};
};
try {
return await this.helpers.request!(options);
@@ -67,3 +68,33 @@ export async function mandrillApiRequest(this: IHookFunctions | IExecuteFunction
}
return toEmailArray
}
export function getGoogleAnalyticsDomainsArray(string: String): Array<any> {
let array = []
if (string.split(',').length > 0) {
array = string.split(',')
} else {
array = [string]
}
return array
}
export function getTags(string: String): Array<any> {
let array = []
if (string.split(',').length > 0) {
array = string.split(',')
} else {
array = [string]
}
return array
}
export function validateJSON(json: any): any {
let result
try {
result = JSON.parse(json)
} catch (exception) {
result = []
}
return result
}