diff --git a/.env.sample b/.env.sample index f86ad90..17de27c 100644 --- a/.env.sample +++ b/.env.sample @@ -18,4 +18,5 @@ NEXT_PUBLIC_CONTENTFUL_SPACE="" NEXT_PUBLIC_MAIL_APP_PASS="" NEXT_PUBLIC_MAIL_APP_USER="" -NEXT_PUBLIC_MAIL_APP_TO="" \ No newline at end of file +NEXT_PUBLIC_MAIL_APP_TO="" +NEXT_PUBLIC_MAIL_APP_CC="" \ No newline at end of file diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml index 183b4b1..3348ca6 100644 --- a/.github/workflows/deploy-beta.yml +++ b/.github/workflows/deploy-beta.yml @@ -41,6 +41,7 @@ jobs: NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }} NEXT_PUBLIC_CONTENTFUL_SPACE=${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE }} NEXT_PUBLIC_MAIL_APP_TO=${{ vars.NEXT_PUBLIC_MAIL_APP_TO }} + NEXT_PUBLIC_MAIL_APP_CC=${{ vars.NEXT_PUBLIC_MAIL_APP_CC }} NEXT_PUBLIC_MAIL_APP_USER=${{ vars.NEXT_PUBLIC_MAIL_APP_USER }} NEXT_PUBLIC_MAIL_APP_PASS=${{ secrets.NEXT_PUBLIC_MAIL_APP_PASS }} diff --git a/.github/workflows/deploy-oca.yml b/.github/workflows/deploy-oca.yml index 2e86d9c..dea9936 100644 --- a/.github/workflows/deploy-oca.yml +++ b/.github/workflows/deploy-oca.yml @@ -42,6 +42,7 @@ jobs: NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }} NEXT_PUBLIC_CONTENTFUL_SPACE=${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE }} NEXT_PUBLIC_MAIL_APP_TO=${{ vars.NEXT_PUBLIC_MAIL_APP_TO }} + NEXT_PUBLIC_MAIL_APP_CC=${{ vars.NEXT_PUBLIC_MAIL_APP_CC }} NEXT_PUBLIC_MAIL_APP_USER=${{ vars.NEXT_PUBLIC_MAIL_APP_USER }} NEXT_PUBLIC_MAIL_APP_PASS=${{ secrets.NEXT_PUBLIC_MAIL_APP_PASS }} diff --git a/Dockerfile.production b/Dockerfile.production index 6cd104d..028a024 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -7,6 +7,7 @@ ARG NEXT_PUBLIC_GEE_PRIVATE_KEY ARG NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN ARG NEXT_PUBLIC_CONTENTFUL_SPACE ARG NEXT_PUBLIC_MAIL_APP_TO +ARG NEXT_PUBLIC_MAIL_APP_CC ARG NEXT_PUBLIC_MAIL_APP_USER ARG NEXT_PUBLIC_MAIL_APP_PASS @@ -17,6 +18,7 @@ ENV NEXT_PUBLIC_GEE_PRIVATE_KEY=$NEXT_PUBLIC_GEE_PRIVATE_KEY ENV NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=$NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN ENV NEXT_PUBLIC_CONTENTFUL_SPACE=$NEXT_PUBLIC_CONTENTFUL_SPACE ENV NEXT_PUBLIC_MAIL_APP_TO=$NEXT_PUBLIC_MAIL_APP_TO +ENV NEXT_PUBLIC_MAIL_APP_CC=$NEXT_PUBLIC_MAIL_APP_CC ENV NEXT_PUBLIC_MAIL_APP_USER=$NEXT_PUBLIC_MAIL_APP_USER ENV NEXT_PUBLIC_MAIL_APP_PASS=$NEXT_PUBLIC_MAIL_APP_PASS diff --git a/Makefile b/Makefile index b9318cc..465d493 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ docker-build-prod: --build-arg NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN=${NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN} \ --build-arg NEXT_PUBLIC_CONTENTFUL_SPACE=${NEXT_PUBLIC_CONTENTFUL_SPACE} \ --build-arg NEXT_PUBLIC_MAIL_APP_TO=${NEXT_PUBLIC_MAIL_APP_TO} \ + --build-arg NEXT_PUBLIC_MAIL_APP_CC=${NEXT_PUBLIC_MAIL_APP_CC} \ --build-arg NEXT_PUBLIC_MAIL_APP_USER=${NEXT_PUBLIC_MAIL_APP_USER} \ --build-arg NEXT_PUBLIC_MAIL_APP_PASS=${NEXT_PUBLIC_MAIL_APP_PASS} \ -t $(IMAGE_NAME) \ diff --git a/src/app/api/mail/route.ts b/src/app/api/mail/route.ts index 5840287..55cb769 100644 --- a/src/app/api/mail/route.ts +++ b/src/app/api/mail/route.ts @@ -8,6 +8,7 @@ export async function POST(req: NextRequest) { const password = process.env.NEXT_PUBLIC_MAIL_APP_PASS; const from = process.env.NEXT_PUBLIC_MAIL_APP_USER; const to = process.env.NEXT_PUBLIC_MAIL_APP_TO; + const cc = process.env.NEXT_PUBLIC_MAIL_APP_CC; const transporter = nodemailer.createTransport({ service: "Gmail", @@ -23,7 +24,7 @@ export async function POST(req: NextRequest) { await transporter.sendMail({ from: from, to: to, - cc: email, + cc: [email, cc], subject: `Nova mensagem de ${name}`, text: message, });