-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98dafd6
commit 531ee55
Showing
19 changed files
with
8,368 additions
and
3,852 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import { Timestamp } from '@google-cloud/firestore'; | ||
import axios from 'axios'; | ||
import * as admin from 'firebase-admin'; | ||
import * as functions from 'firebase-functions'; | ||
import { writeFileSync } from 'fs'; | ||
///import * as markdownToPDf from 'markdown-pdf'; | ||
import * as os from 'os'; | ||
|
||
import relanceConventionSignee from './emails/template/relanceConventionSignee'; | ||
import relanceInformationsComplementaires from './emails/template/relanceInformationsComplementaires'; | ||
import relancePaiement from './emails/template/relancePaiement'; | ||
import type { Company, Configuration, EmailContent, WorkflowStatus } from './model'; | ||
import { StatusEnum, onDocumentChange } from './utils/document-change'; | ||
import { sendEmail, sendEmailToAllContacts } from './utils/mail'; | ||
import { sendEmailToAllContacts } from './utils/mail'; | ||
import { sendNewPartnerToOrganizationTeam, sendWelcomeEmail } from './v3/domain/email'; | ||
import { getConfiguration } from './v3/infrastructure/getConfiguration'; | ||
|
||
|
@@ -46,9 +50,20 @@ export const getAllPublicSponsors = functions.https.onRequest(async (req, resp) | |
}); | ||
|
||
export const testEmail = functions.https.onRequest(async (req, resp) => { | ||
const configuration = await getConfiguration(firestore); | ||
await sendEmail(['[email protected]'], 'subject', 'body', configuration); | ||
resp.send(1); | ||
const content = '# Title 23'; | ||
const path = os.tmpdir() + '/test2.pdf'; | ||
axios | ||
.post('https://hook.eu2.make.com/bng7a8nbgg7093u3oofkwmm2t1hl9omd', content, { | ||
responseType: 'arraybuffer', | ||
headers: { | ||
'Content-Type': 'text/plain' | ||
} | ||
}) | ||
.then((body) => { | ||
writeFileSync(path, body.data); | ||
resp.send(path); | ||
}) | ||
.catch((err: string) => console.log(err)); | ||
}); | ||
|
||
const relance = (emailFactory: (partner: Company, configuration: Configuration) => EmailContent, partners: Company[], configuration: Configuration) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 22 additions & 15 deletions
37
functions/src/generator/lib/template_devfest/convention_fr.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.