Skip to content
Snippets Groups Projects
Commit 90274d96 authored by Dan Braghis's avatar Dan Braghis Committed by Todd Dembrey
Browse files

Add in confirmation email

parent 87e25688
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-25 10:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funds', '0012_add_fullname_email_block_fields'),
]
operations = [
migrations.AddField(
model_name='fundtype',
name='confirmation_text_extra',
field=models.TextField(blank=True, help_text='Additional text for the application confirmation message.'),
),
migrations.AddField(
model_name='fundtype',
name='from_address',
field=models.CharField(blank=True, max_length=255, verbose_name='from address'),
),
migrations.AddField(
model_name='fundtype',
name='subject',
field=models.CharField(blank=True, max_length=255, verbose_name='subject'),
),
migrations.AddField(
model_name='fundtype',
name='to_address',
field=models.CharField(blank=True, help_text='Optional - form submissions will be emailed to these addresses. Separate multiple addresses by comma.', max_length=255, verbose_name='to address'),
),
]
......@@ -16,14 +16,14 @@ from django.utils.translation import ugettext_lazy as _
from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel,
InlinePanel,
FieldRowPanel,
InlinePanel,
MultiFieldPanel,
StreamFieldPanel,
)
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailcore.models import Orderable
from wagtail.wagtailforms.models import AbstractFormSubmission
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormSubmission
from opentech.apply.stream_forms.models import AbstractStreamForm
......@@ -92,7 +92,7 @@ class SubmittableStreamForm(AbstractStreamForm):
return kwargs
class DefinableWorkflowStreamForm(AbstractStreamForm):
class DefinableWorkflowStreamForm(AbstractEmailForm, AbstractStreamForm):
class Meta:
abstract = True
......@@ -104,6 +104,7 @@ class DefinableWorkflowStreamForm(AbstractStreamForm):
}
workflow = models.CharField(choices=WORKFLOWS.items(), max_length=100, default='single')
confirmation_text_extra = models.TextField(blank=True, help_text="Additional text for the application confirmation message.")
def get_defined_fields(self):
# Only return the first form, will need updating for when working with 2 stage WF
......@@ -116,6 +117,18 @@ class DefinableWorkflowStreamForm(AbstractStreamForm):
content_panels = AbstractStreamForm.content_panels + [
FieldPanel('workflow'),
InlinePanel('forms', label="Forms"),
MultiFieldPanel(
[
FieldRowPanel([
FieldPanel('from_address', classname="col6"),
FieldPanel('to_address', classname="col6"),
]),
FieldPanel('subject'),
FieldPanel('confirmation_text_extra'),
],
heading="Confirmation email",
classname="collapsible collapsed"
),
]
......@@ -263,6 +276,10 @@ class LabType(DefinableWorkflowStreamForm, SubmittableStreamForm): # type: igno
parent_page_types = ['apply_home.ApplyHomePage']
subpage_types = [] # type: ignore
def get_defined_fields(self):
# Only return the first form, will need updating for when working with 2 stage WF
return self.specific.forms.all()[0].fields
def get_submit_meta_data(self, **kwargs):
return super().get_submit_meta_data(
page=self,
......
Dear {{ name|default:"applicant" }},
We appreciate your {{ fund_type }} application submission to the Open Technology Fund. We will review and reply to your
submission as quickly as possible. Our reply will have the next steps for your {{ fund_type }} application.
You can find more information about our support options, review process and selection criteria on our website.
{% if extra_text %}{{ extra_text }}{% endif %}
If you have any questions, please email us at info@opentechfund.org.
{% if project_name %}Project name: {{ project_name }}{% endif %}
{% if name %}Contact name: {{ name }}{% endif %}
{% if email %}Contact email: {{ email }}{% endif %}
Thanks again,
The OTF Team
--
Open Technology Fund
https://www.opentech.fund/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment