File size: 750 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
export const generateMailToLink = (email: string, subject?: string, body?: string): string => {
  let mailtoLink = `mailto:${email}`

  if (subject)
    mailtoLink += `?subject=${encodeURIComponent(subject)}`

  if (body)
    mailtoLink += `&body=${encodeURIComponent(body)}`

  return mailtoLink
}

export const mailToSupport = (account: string, plan: string, version: string) => {
  const subject = `Technical Support Request ${plan} ${account}`
  const body = `
    Please do not remove the following information:
    -----------------------------------------------
    Current Plan: ${plan}
    Account: ${account}
    Version: ${version}
    Platform:
    Problem Description:
  `
  return generateMailToLink('[email protected]', subject, body)
}