<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Newsletter</name><description>Add a newsletter subscription form</description><help><![CDATA[The Newsletter block displays a small form allowing users to subscribe to your website newsletter.&lt;br&gt; You can then create newsletters, subject and rich content (containing styles, links, images...), and send them to all your subscribers.&lt;br&gt; By using this block, visitors can easily subscribe and unsubscribe to your newsletter, and you can contact them easily. ]]></help><api_version>1.0</api_version><size height='50' width='180' /><server>local://NewsletterCptServer</server><blog en='163' /><gdpr enabled='true' /></metadata><view><content>&lt;form&gt;
  &lt;input type=text class=&quot;uin_i site_textbox&quot; placeholder=&quot;Enter your email&quot; /&gt;
  &lt;div class=&quot;component_gdpr_container uin_gdpr&quot;&gt;&lt;/div&gt;
	&lt;input type=submit value=&quot;Subscribe&quot; class=&quot;uin_s site_button cta&quot;/&gt;
&lt;/form&gt;
</content><properties><server_manage help='Create and send newsletters to your subscribers.' icon='ui_newsletter' name='manage' text='Manage newsletters' url='/Newsletter-management/' /></properties></view><script>UI_List.UI_Newsletter={initialize:function(a){this.cpt=a;
a.setOptions([&quot;locked&quot;,&quot;fixed&quot;,&quot;footer&quot;,&quot;sticky&quot;])
},onDisplay:function(b){this.node=b;
this.n={gdpr:b.find(&quot;.component_gdpr_container&quot;)};
this.form=this.node.find(&quot;form&quot;);
this.mail=this.node.find(&quot;input:first&quot;);
this.btn=this.node.find(&quot;input:last&quot;);
var a=this;
this.size_getter_el=$(&quot;&lt;div&gt;&lt;/div&gt;&quot;).appendTo(b).css(&quot;clear&quot;,&quot;both&quot;)[0];
this.form.submit(function(){if(a.testFormGdpr(a.form)){a._subscribe()
}return false
});
$.extend(this,componentGdpr);
this.initGdpr();
this.onResizeStop()
},onPropertyChanged:function(a){},onResizeStop:function(){this.cpt.setSize({h:10000});
this.cpt.setSize({h:this.size_getter_el.offsetTop+2,w:this.cpt.W()&gt;100?null:130})
},onSelect:function(){this.updateGdpr()
},_subscribe:function(){var a=this;
var b=this.mail.val();
if(b.match(/^.*@.+\.\w{2,3}$/)){this.cpt.ask({request:&quot;subscribe&quot;,email:b,gdpr:this.getGdpr(this.n.gdpr)},function(c){a._stopForm();
alert(&quot;Congratulations! &quot;+sprintf(&quot;You just subscribed to the %1$s newsletter.&quot;,window.location.host)+sprintf(&quot;\nCheck your inbox or spam box at your provider (%1$s) now to validate your subscription.&quot;,b.replace(/.*@/,&quot;&quot;)))
},function(d){var c=(Array.isArray(d[0]))?d[0].join(&quot;\n&quot;):d[0];
if(c==&quot;email&quot;){a._emailInvalid()
}else{alert(c)
}if(d[1]){a._stopForm()
}})
}else{this._emailInvalid()
}},_emailInvalid:function(){alert(&quot;Impossible to subscribe to the newsletter: the email address is invalid.\nPlease check your email address and try again.&quot;)
},_stopForm:function(){this.form.replaceWith(&quot;&lt;div class=&apos;uin_sb&apos;&gt;Subscribed! Check your emails...&lt;/div&gt;&quot;);
this.onResizeStop()
},onFontFamilyUpdate:function(){this.onResizeStop()
}};</script><style>.uin_i{width:100%;box-sizing:border-box}
.uin_sb{background:#60D893;color:#fff;padding:5px;text-align:center}
.componentBody.UI_Newsletter&gt;form{text-align:center}
.UI_Newsletter .uin_s{margin-top:2px}</style></uidget>