Example #1
0
from .notify_events import PasswordReset

mark_safe_lazy = lazy(mark_safe, six.text_type)

PASSWORD_RESET_EMAIL_TEMPLATE = mark_safe_lazy(
    _("""
<p>Hi {{ user_to_recover.get_full_name() }},</p>

<p>In case you've forgotten, your username is {{ user_to_recover.username }}.</p>
<p>You're receiving this email because you requested a password reset for your user account at {{ site_name }}.</p>
<p>Please go to the following page and choose a new password:</p>
<br>
<a href="{{ recovery_url }}">{{ recovery_url }}</a>
"""))

PasswordResetTemplate = generic_send_email_script_template_factory(
    identifier="shuup_notify_password_reset",
    event=PasswordReset,
    name=_("Send Password Reset Link"),
    description=_("""
        Send an email to user when their account password reset is requested
    """),
    help_text=_("""
        This script will send an email to user once their account password reset is
        requested either by admin, staff or user.
    """),
    initial={
        "en-subject": "Password Recovery",
        "en-body": PASSWORD_RESET_EMAIL_TEMPLATE
    })
Example #2
0
            <td>{{ shipment_product.product }}</td>
            <td>{{ shipment_product.quantity }}</td>
        </tr>
{% endif %}
    </tbody>
</table>
"""))

ShipmentCreatedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="shipment_created_email",
    event=ShipmentCreated,
    name=_("Send Shipment Created Email"),
    description=_("Send an email to customer when a shipment is created."),
    help_text=
    _("This script will send an email to customer when a shipment of his order has been created."
      ),
    initial={
        "en-subject":
        _("{{ order.shop }} - Shipment created for order {{ order.identifier }}"
          ),
        "en-body":
        SHIPMENT_CREATED_EMAIL_TEMPLATE
    })

ShipmentDeletedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="shipment_deleted_email",
    event=ShipmentDeleted,
    name=_("Send Shipment Deleted Email"),
    description=_("Send email when a shipment is deleted."),
    help_text=_(
        "This script will send an email to customer or to any configured email "
Example #3
0
        activation_url = request.build_absolute_uri(activation_path)

    email = user.email or instance.email
    customer = instance
    event = CompanyApproved(customer=customer,
                            customer_email=email,
                            user_is_active=user.is_active,
                            activation_url=activation_url)
    event.run(shop=request.shop)


RegistrationReceivedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="registration_received_email",
    event=RegistrationReceived,
    name=_("Send Registration Received Email"),
    description=_("Send email when a user registers."),
    help_text=_(
        "This script will send an email to the user or to any configured email "
        "right after a user get registered."),
    initial={"en-subject": _("{{ order.shop }} - Welcome!")})

AccountReactivationEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="account_reactivated",
    event=AccountReactivation,
    name=_("Send account reactivation email"),
    description=_("Send email when a user account gets reactivated"),
    help_text=_(
        "This script will send an email to the user or to any configured email "
        "when a account get's reactivated"),
    initial={"en-subject": _("{{ customer.username }} is now active again!")})
Example #4
0
    customer = instance
    event = CompanyApproved(
        customer=customer,
        customer_email=email,
        user_is_active=user.is_active,
        activation_url=activation_url
    )
    event.run(shop=request.shop)


RegistrationReceivedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="registration_received_email",
    event=RegistrationReceived,
    name=_("Send Registration Received Email"),
    description=_("Send email when a user registers."),
    help_text=_("This script will send an email to the user or to any configured email "
                "right after a user get registered."),
    initial=dict(
        subject=_("{{ order.shop }} - Welcome!")
    )
)

CompanyRegistrationReceivedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="company_registration_received_email",
    event=CompanyRegistrationReceived,
    name=_("Send Company Registration Received Email"),
    description=_("Send email when a user registers as a company."),
    help_text=_("This script will send an email to the user or to any configured email "
                "right after a user get registered."),
    initial=dict(
        subject=_("{{ order.shop }} - Welcome!")
Example #5
0
        <tr>
            <td>{{ shipment_product.product }}</td>
            <td>{{ shipment_product.quantity }}</td>
        </tr>
{% endif %}
    </tbody>
</table>
"""))


ShipmentCreatedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="shipment_created_email",
    event=ShipmentCreated,
    name=_("Send Shipment Created Email"),
    description=_("Send an email to customer when a shipment is created."),
    help_text=_("This script will send an email to customer when a shipment of his order has been created."),
    initial=dict(
        subject=_("{{ order.shop }} - Shipment created for order {{ order.identifier }}"),
        body=SHIPMENT_CREATED_EMAIL_TEMPLATE
    )
)

ShipmentDeletedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="shipment_deleted_email",
    event=ShipmentDeleted,
    name=_("Send Shipment Deleted Email"),
    description=_("Send email when a shipment is deleted."),
    help_text=_("This script will send an email to customer or to any configured email "
                "right after a shipment gets deleted."),
    initial=dict(
        subject=_("{{ order.shop }} - Shipment deleted for order {{ order.identifier }}")
Example #6
0
    customer = instance
    event = CompanyApproved(
        customer=customer,
        customer_email=email,
        user_is_active=user.is_active,
        activation_url=activation_url
    )
    event.run(shop=request.shop)


RegistrationReceivedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="registration_received_email",
    event=RegistrationReceived,
    name=_("Send Registration Received Email"),
    description=_("Send email when a user registers."),
    help_text=_("This script will send an email to the user or to any configured email "
                "right after a user get registered."),
    initial=dict(
        subject=_("{{ order.shop }} - Welcome!")
    )
)

CompanyRegistrationReceivedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="company_registration_received_email",
    event=CompanyRegistrationReceived,
    name=_("Send Company Registration Received Email"),
    description=_("Send email when a user registers as a company."),
    help_text=_("This script will send an email to the user or to any configured email "
                "right after a user get registered."),
    initial=dict(
        subject=_("{{ order.shop }} - Welcome!")
Example #7
0
from shuup.notify.script_template.factory import \
    generic_send_email_script_template_factory
from shuup.notify.typology import Email


class RegistrationReceived(Event):
    identifier = "registration_received"
    name = _("Registration Received")

    customer_email = Variable(_("Customer Email"), type=Email)


@receiver(user_registered)
def send_user_registered_notification(user, **kwargs):
    RegistrationReceived(
        customer_email=user.email,
    ).run()


RegistrationReceivedEmailScriptTemplate = generic_send_email_script_template_factory(
    identifier="registration_received_email",
    event=RegistrationReceived,
    name=_("Send Registration Received Email"),
    description=_("Send email when a user registers."),
    help_text=_("This script will send an email to the user or to any configured email "
                "right after a user get registered."),
    initial=dict(
        subject=_("{{ order.shop }} - Welcome!")
    )
)