Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Update readme for 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Sage committed May 27, 2015
1 parent 7a829df commit d940bdd
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ Picreel doesn't do <code>&lt;form&gt;</code>s, but it does do <code>&lt;input&gt
In the editor you would place the following:

```JavaScript
<script src="//my-cloudfront-dist-id.cloudfront.net/libs/picreel/0.1.0/picreel.min.js"></script>
<script src="//my-cloudfront-dist-id.cloudfront.net/libs/picreel/0.4.0/picreel.min.js"></script>
<script>
if(window.jQuery){

jQuery(document).ready(function($) {
var params = {
submitSelector: "#submit-button",
emailSelector: "input[name='email']",
action: "https://www.countryoutfitter.com/my_form_handler/",
action: "https://www.mydomain.com/my_form_handler/",
list: "STYLE"
};
window.APLS = new APLSubscriber(params);
Expand All @@ -59,6 +59,54 @@ In the editor you would place the following:
</script>
```

### Implementation with vars

Sailthru [Vars](http://getstarted.sailthru.com/new-for-developers-overview/email-and-user-profiles/user/#POST Mode - Optional Parameters - vars 2) may added to templates and will be submitted as event vars and profile varswhen a user subscribes. All vars submitted will be made to equal the value _1_.

Simply add an array of vars to the template editor, as in the following example:

```JavaScript
<script src="//my-cloudfront-dist-id.cloudfront.net/libs/picreel/0.4.0/picreel.min.js"></script>
<script>
if(window.jQuery){

jQuery(document).ready(function($) {
var params = {
action: "https://www.mydomain.com/my_form_handler/",
list: "SUBSCRIBERS",
vars: ["giveaway", "example"]
};
window.APLS = new APLSubscriber(params);
});

};
</script>
```

### Implementation with a custom event name

Sailthru will accept any event name, but you will have to configure which event names have triggers in Sailthru.

For a custom event name, add it as a string:

```JavaScript
<script src="//my-cloudfront-dist-id.cloudfront.net/libs/picreel/0.4.0/picreel.min.js"></script>
<script>
if(window.jQuery){

jQuery(document).ready(function($) {
var params = {
action: "https://www.mydomain.com/my_form_handler/",
list: "SUBSCRIBERS",
event: "my_event_name"
};
window.APLS = new APLSubscriber(params);
});

};
</script>
```

_NOTE 1: Pireel's editor does not load jQuery, but we're dependent on jQuery. Therefore, be sure to wrap <code>new APLSubscriber</code> declaration in <code>if(window.jQuery)</code>_

_NOTE 2: Most new APLS attributes may be specified when creating a new object. See <code>lib/factories/subscriber.js</code> for what may be created as arguments_

0 comments on commit d940bdd

Please sign in to comment.