import { fetchAPI, getAPIUrl, SendMailVars } from './api'; import { sendMailMutation } from './contact.mutation'; export type SentEmail = { clientMutationId: string; message: string; origin: string; replyTo: string; sent: boolean; }; /** * Send an email using GraphQL API. * * @param {sendMailVars} data - The mail data. * @returns {Promise} The mutation response. */ export const sendMail = async (data: SendMailVars): Promise => { const response = await fetchAPI({ api: getAPIUrl(), query: sendMailMutation, variables: { ...data }, }); return response.sendEmail; }; cgit logo index : www.armandphilippot.com
The frontend of my personal website.Armand Philippot
summaryrefslogtreecommitdiffstats
blob: 297ce149488461f428770bc70172a27ecdd3d864 (plain)
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