<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Newsletter</name><description>Add a newsletter subscription form</description><help>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='120' /><server>local://NewsletterCptServer</server><blog en='160' fr='159' /></metadata><view><content>&lt;form&gt;
    &lt;input type=text class=&quot;uin_i&quot; /&gt;
	&lt;input type=submit value=&quot;Subscribe&quot; class=&quot;uin_s&quot;/&gt;
&lt;/form&gt;</content><properties><trigger help='Create and send newsletters to your subscribers.' icon='ui_newsletter' text='Manage Newsletters' trigger='manage' /></properties></view><script>UI_List.UI_Newsletter={initialize:function(a){this.cpt=a;
a.setOptions([&quot;locked&quot;])
},onDisplay:function(b){this.node=b;
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(){a._subscribe();
return false
});
this.onResizeStop()
},onPropertyChanged:function(a){if(a.include(&quot;manage&quot;)){window.open(&quot;/Newsletter-management/&quot;+v.site_id)
}},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})
},_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},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=d[0].join(&quot;\n&quot;);
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:95%}
.uin_sb{background:#DBE6DE url(/assets/icons/apply.gif) no-repeat scroll 5px 5px;border:1px solid #91EF88;color:#222;font-weight:700;padding:5px 2px 5px 10px;text-align:center}</style></uidget>