Skip to content

Commit

Permalink
Merge pull request #92 from OCA-UFCG/refact/modifyEmail
Browse files Browse the repository at this point in the history
refact/modify the email direct
  • Loading branch information
abraaovalentim authored Oct 8, 2024
2 parents 19e292f + 271691f commit fd95d21
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ NEXT_PUBLIC_CONTENTFUL_SPACE=""

NEXT_PUBLIC_MAIL_APP_PASS=""
NEXT_PUBLIC_MAIL_APP_USER=""
NEXT_PUBLIC_MAIL_APP_TO=""
NEXT_PUBLIC_MAIL_APP_TO=""
NEXT_PUBLIC_MAIL_APP_CC=""
1 change: 1 addition & 0 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-oca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
3 changes: 2 additions & 1 deletion src/app/api/mail/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
});
Expand Down

0 comments on commit fd95d21

Please sign in to comment.