Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
5e96eae9
Commit
5e96eae9
authored
2 months ago
by
Alexa Valentová
Browse files
Options
Downloads
Patches
Plain Diff
add recipient email
parent
097980d0
No related branches found
No related tags found
2 merge requests
!1233
Release
,
!1230
add recipient email
Pipeline
#20677
passed
2 months ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/models.py
+27
-5
27 additions, 5 deletions
main/models.py
with
27 additions
and
5 deletions
main/models.py
+
27
−
5
View file @
5e96eae9
...
...
@@ -620,7 +620,26 @@ class MainCareerPage(
for
file
in
form
.
cleaned_data
[
"
other_files
"
]:
other_files_names
+=
f
"
-
{
file
.
name
}
\n
"
email
=
EmailMessage
(
recipient_email
=
EmailMessage
(
# Subject
f
"
Potvrzení přihlášky k pracovní pozici
{
self
.
title
}
"
,
# Message
f
"""
Dobrý den,
potvrzujeme přijetí Vaší přihlášky k pracovní pozici
'
{
self
.
title
}
'
.
Budeme vás co nejdříve kontaktovat s dalšími informacemi.
Děkujeme,
Pirátská Strana
"""
,
# From email
"
vyberka@pirati.cz
"
,
# To email
form
.
cleaned_data
[
'
email
'
]
)
administrator_email
=
EmailMessage
(
# Subject
f
"
Nová přihláška k pracovní pozici
{
self
.
title
}
-
{
form
.
cleaned_data
[
'
name
'
]
}
{
form
.
cleaned_data
[
'
surname
'
]
}
"
,
# Message
...
...
@@ -654,14 +673,14 @@ Při otevírání souborů buďte opatrní, virový proběhl, ale nemusí být p
)
form
.
cleaned_data
[
"
cv_file
"
].
seek
(
0
)
email
.
attach
(
administrator_
email
.
attach
(
form
.
cleaned_data
[
"
cv_file
"
].
name
,
form
.
cleaned_data
[
"
cv_file
"
].
read
(),
form
.
cleaned_data
[
"
cv_file
"
].
content_type
,
)
form
.
cleaned_data
[
"
cover_letter_file
"
].
seek
(
0
)
email
.
attach
(
administrator_
email
.
attach
(
form
.
cleaned_data
[
"
cover_letter_file
"
].
name
,
form
.
cleaned_data
[
"
cover_letter_file
"
].
read
(),
form
.
cleaned_data
[
"
cover_letter_file
"
].
content_type
,
...
...
@@ -669,9 +688,12 @@ Při otevírání souborů buďte opatrní, virový proběhl, ale nemusí být p
for
file
in
form
.
cleaned_data
[
"
other_files
"
]:
file
.
seek
(
0
)
email
.
attach
(
file
.
name
,
file
.
read
(),
file
.
content_type
)
administrator_
email
.
attach
(
file
.
name
,
file
.
read
(),
file
.
content_type
)
sent_successfully
=
email
.
send
()
sent_successfully
=
(
administrator_email
.
send
()
and
recipient_email
.
send
()
)
if
sent_successfully
:
messages
.
add_message
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment