Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sneha
LaMartin-Webomagic
Commits
a552fdf3
Commit
a552fdf3
authored
Aug 08, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add bcc emails for interview and admission
parent
3235a0d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
7 deletions
+33
-7
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
.../admission/dao/controller/AdmissionFormDAOController.java
+31
-6
lamartinBackend/src/main/java/com/example/LaMartin/common/service/EmailService.java
...ava/com/example/LaMartin/common/service/EmailService.java
+2
-1
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
View file @
a552fdf3
...
@@ -136,8 +136,24 @@ public class AdmissionFormDAOController {
...
@@ -136,8 +136,24 @@ public class AdmissionFormDAOController {
ByteArrayInputStream
pdfStream
=
pdfService
.
convertHtmlToPdf
(
emailBody
);
ByteArrayInputStream
pdfStream
=
pdfService
.
convertHtmlToPdf
(
emailBody
);
String
[]
bcc
=
{
"paritoshcanning@yahoo.co.in"
,
"secretary@lamartiniere.co"
,
"lmcao@lamartiniere.co"
,
"secretariat_lmb@lamartiniere.co"
};
if
(!
data
.
getSchool
().
equals
(
"La Martiniere for Boys"
))
{
bcc
=
new
String
[]{
"paritoshcanning@yahoo.co.in"
,
"secretary@lamartiniere.co"
,
"lmcao@lamartiniere.co"
,
"lmgkolkata@gmail.com"
};
}
this
.
emailService
.
sendHtmlEmail
(
this
.
emailService
.
sendHtmlEmail
(
data
.
getFatherEmail
(),
data
.
getFatherEmail
(),
bcc
,
"SCHEDULED INTERVIEW | "
+
data
.
getSchool
().
toUpperCase
(),
"SCHEDULED INTERVIEW | "
+
data
.
getSchool
().
toUpperCase
(),
emailBody
,
emailBody
,
pdfStream
pdfStream
...
@@ -163,16 +179,25 @@ public class AdmissionFormDAOController {
...
@@ -163,16 +179,25 @@ public class AdmissionFormDAOController {
ByteArrayInputStream
pdfStream
=
pdfService
.
convertHtmlToPdf
(
emailBody
);
ByteArrayInputStream
pdfStream
=
pdfService
.
convertHtmlToPdf
(
emailBody
);
String
principalEmail
=
"secretariat_lmb@lamartiniere.co"
;
String
[]
bcc
=
{
"paritoshcanning@yahoo.co.in"
,
"secretary@lamartiniere.co"
,
"lmcao@lamartiniere.co"
,
"secretariat_lmb@lamartiniere.co"
};
if
(!
Objects
.
equals
(
data
.
getSchool
(),
"La Martiniere for Boys"
))
{
if
(!
data
.
getSchool
().
equals
(
"La Martiniere for Boys"
))
{
principalEmail
=
"lmgkolkata@gmail.com"
;
bcc
=
new
String
[]{
"paritoshcanning@yahoo.co.in"
,
"secretary@lamartiniere.co"
,
"lmcao@lamartiniere.co"
,
"lmgkolkata@gmail.com"
};
}
}
String
[]
recipients
=
{
data
.
getFatherEmail
(),
principalEmail
};
this
.
emailService
.
sendHtmlEmail
(
this
.
emailService
.
sendHtmlEmail
(
recipients
,
data
.
getFatherEmail
(),
bcc
,
"ADMISSION APPOINTMENT | "
+
data
.
getSchool
().
toUpperCase
(),
"ADMISSION APPOINTMENT | "
+
data
.
getSchool
().
toUpperCase
(),
emailBody
,
emailBody
,
pdfStream
pdfStream
...
...
lamartinBackend/src/main/java/com/example/LaMartin/common/service/EmailService.java
View file @
a552fdf3
...
@@ -40,11 +40,12 @@ public class EmailService {
...
@@ -40,11 +40,12 @@ public class EmailService {
mailSender
.
send
(
message
);
mailSender
.
send
(
message
);
}
}
public
void
sendHtmlEmail
(
String
[]
to
,
String
subject
,
String
htmlBody
,
ByteArrayInputStream
attachment
)
throws
MessagingException
,
IOException
{
public
void
sendHtmlEmail
(
String
to
,
String
[]
bcc
,
String
subject
,
String
htmlBody
,
ByteArrayInputStream
attachment
)
throws
MessagingException
,
IOException
{
MimeMessage
message
=
mailSender
.
createMimeMessage
();
MimeMessage
message
=
mailSender
.
createMimeMessage
();
MimeMessageHelper
helper
=
new
MimeMessageHelper
(
message
,
true
);
MimeMessageHelper
helper
=
new
MimeMessageHelper
(
message
,
true
);
helper
.
setSubject
(
subject
);
helper
.
setSubject
(
subject
);
helper
.
setTo
(
to
);
helper
.
setTo
(
to
);
helper
.
setBcc
(
bcc
);
helper
.
setText
(
htmlBody
,
true
);
// true indicates HTML
helper
.
setText
(
htmlBody
,
true
);
// true indicates HTML
ByteArrayDataSource
dataSource
=
new
ByteArrayDataSource
(
attachment
,
"application/pdf"
);
ByteArrayDataSource
dataSource
=
new
ByteArrayDataSource
(
attachment
,
"application/pdf"
);
helper
.
addAttachment
(
"interaction.pdf"
,
dataSource
);
helper
.
addAttachment
(
"interaction.pdf"
,
dataSource
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment