Skip to content

Files to add your own Newsletter2Go subscribe / unsubscribe form to your Shopware Template

License

Notifications You must be signed in to change notification settings

mmoollllee/Newsletter2Go-Shopware-Form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Newsletter2Go Signup & Signout Form for Shopware

This guide extends the official Newsletter2Go Help Article How Can I Create My Own HTML Form?, that delivers Screenshots of the code snippets. WTF. Made this for Shopware 5. Must be easy to adopt for plain HTML.

Guide

  1. Create a Form in the Newsletter2Go UI and get the Code Snippet that you might have used to display their javascript form. Looks like this:
<script id="n2g_script">!function(e,t,n,c,r,a,i){e.Newsletter2GoTrackingObject=r,e[r]=e[r]||function(){(e[r].q=e[r].q||[]).push(arguments)},e[r].l=1*new Date,a=t.createElement(n),i=t.getElementsByTagName(n)[0],a.async=1,a.src=c,i.parentNode.insertBefore(a,i)}(window,document,"script","https://static.newsletter2go.com/utils.js","n2g");var config = {"container": {"type": "div","class": "","style": ""},"row": {"type": "div","class": "","style": "margin-top: 15px;"},"columnLeft": {"type": "div","class": "","style": ""},"columnRight": {"type": "div","class": "","style": ""},"label": {"type": "label","class": "","style": ""}};n2g('create', 'xxxxxxxx-xxxxxxxx-xxx');n2g('subscribe:createForm', config);</script>
  1. Let's tidy that up. See jquery.newsletter2go.js and add your key in line 57.
  2. Add src/js/jquery.newsletter2go.js to $javascript in your Theme.php
  3. As I want to integrate in Shopware, I use the /frontend/newsletter/index.tpl for the HTML form.
  4. Recompile your template and open /shopware.php?sViewport=newsletter or shopware.php?sViewport=newsletter&signout=false. Add Shoppages to have readable links for that.

About

Files to add your own Newsletter2Go subscribe / unsubscribe form to your Shopware Template

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published