# Newsletter extension 0.1.0

**URL:** <https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016>\
**Category:** Radiant CMS\
**Created:** [January 4, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016 "2008-01-04T16:30:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 4, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/1 "2008-01-04T16:30:29Z")

</div>

Hi there!! I’m working on a new extension that allows to manage  
newsletters.  
Basically a page can be a newsletter (NewsletterPage type) and it has  
its  
own subscribers.  
Each one of its children is an email to send.  
If you want to try it you can check it out with:

svn co  
[http://dev.gravityblast.com/svn/projects/radiant/extensions/newsletter/](http://dev.gravityblast.com/svn/projects/radiant/extensions/newsletter/)

It’s a super beta version but it should work.  
Let me know what you think! thank you very much…and an happy new year!  
🙂

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 4, 2008, 4:45pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/2 "2008-01-04T16:45:45Z")

</div>

Yiha ! This really rocks. (I still have to check it out) I was planning  
in  
writing a newsletter extension.

I will check it out and will try to help/test/patch there were needed.

Peter.

On Jan 4, 2008 4:29 PM, Andrea F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It’s a super beta version but it should work.  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 4, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/3 "2008-01-04T16:55:07Z")

</div>

Nice work, Andrea! Nice use of shards, too. I’m glad to see I’m not  
the only one using it successfully.

Sean

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 4, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/4 "2008-01-04T17:05:38Z")

</div>

On Jan 4, 2008 4:54 PM, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Nice work, Andrea! Nice use of shards, too. I’m glad to see I’m not  
> the only one using it successfully.

Thank you for the shards extension Sean!!! 🙂 It’s very useful to  
customize  
the radiant ui!  
Peter, I’m going to add ar\_mailer support! Using it we can send emails  
with  
a rake task using cron,  
because it currently sends a mail for each newsletter\_subscriber.I hope  
to  
finish in an hour :).

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 4, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/5 "2008-01-04T23:01:52Z")

</div>

Nice, I will take a better look this weekend. First I have to catch up  
some  
sleep 🙂

On Jan 4, 2008 5:04 PM, Andrea F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> with  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 7, 2008, 4:26pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/6 "2008-01-07T16:26:40Z")

</div>

I had some delay with my other “stuff” but I will give it a try this  
evening  
or tomorrow.

Peter.

On Jan 7, 2008 4:13 PM, Andrea F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Then you can send them with the following rake task:  
> Radiant mailing list  
> Post: removed\_email\_address@domain.invalid  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
met vriendelijke groet,

Peter B.

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 7, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/7 "2008-01-07T16:13:41Z")

</div>

On Jan 4, 2008 11:01 PM, Peter B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Nice, I will take a better look this weekend. First I have to catch up  
> some  
> sleep 🙂

I’ve just added ar\_mailer. When you click on the send button, emails are  
saved in the NewsletterEmails table.  
Then you can send them with the following rake task:

rake radiant:extensions:newsletter:email:send

You need to add smtp configurations in the environment.rb file.  
Suggestions and patches are welcome 🙂

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 7, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/8 "2008-01-07T16:49:31Z")

</div>

Hi Andrea,

Nice work with this extension. I’m going to use it for my current  
Radiant project. I’m not so sure I like the idea of having to setup a  
scheduled task to call the rake task at intervals to get newsletters  
sent, but on the other hand it’s not very nice to make mongrel send  
them immediately either.

I’m planning to add some basic tracking stuff to your extension. I was  
thinking to add two tags:

\<r:newsletter:tracking:bug /\> (inserts an image tag which invokes the  
server when the user opens the newsletter. This should be inserted in  
the newsletter layout)  
\<r:newsletter:tracking:link url="…"\>…\</r:newsletter:tracking:link\>  
(wrapping links so the clicks are tracked before the user is  
redirected to the given url)

- but the bug could also be inserted always, and all links could be  
wrapped automatically.

What do you think?

Best regards,  
Casper F.

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 7, 2008, 9:58pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/9 "2008-01-07T21:58:46Z")

</div>

> So I thought to add a rake task…maybe we can add a page that call  
> in ajax  
> the controller that send 20 emails each request but I don’t know…

I think it’s best to add instructions on how to easily schedule the  
rake task to be called every 5 minutes or so. Relying on an Ajax call  
sending 20 pr. call sounds pretty vulnerable to me.

> An other problem is that every time you send a mail, the controller  
> loop  
> through all the subscribers to create a new NewsletterEmail.  
> Does exist a way to do it better?

Well, it could probably be optimized to a single query using an  
INSERT … SELECT statement, but since it an admin call it’s not  
really a big issue I think.

> Do you want to add that image just to track how many times the email  
> is  
> opened?

Well, yes. Clients seem to be pretty happy about knowing how many of  
the recpients has actually opened the newsletter, and how many of them  
clicks the links in it. It just a call to a controller returning a 1x1  
transparent pixel ([Web beacon - Wikipedia](http://en.wikipedia.org/wiki/Web_beacons)).

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 7, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/10 "2008-01-07T18:09:29Z")

</div>

On Jan 7, 2008 4:49 PM, Casper F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Andrea,
> 
> Nice work with this extension. I’m going to use it for my current  
> Radiant project. I’m not so sure I like the idea of having to setup a  
> scheduled task to call the rake task at intervals to get newsletters  
> sent, but on the other hand it’s not very nice to make mongrel send  
> them immediately either.

Thanks for your support Casper 🙂  
I think that if you have more than 200 subscribers, it’s impossible to  
send  
all the emails during a request.  
So I thought to add a rake task…maybe we can add a page that call in  
ajax  
the controller that send 20 emails each request but I don’t know…  
An other problem is that every time you send a mail, the controller loop  
through all the subscribers to create a new NewsletterEmail.  
Does exist a way to do it better?

> - but the bug could also be inserted always, and all links could be  
> wrapped automatically.
> 
> What do you think?

Do you want to add that image just to track how many times the email is  
opened?

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 28, 2008, 8:19am UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/11 "2008-01-28T08:19:09Z")

</div>

Hi to all…

```
Am newbie to RoR and Radiant CMS....

```

I want to use newsletter extension in my application which is developed  
in ruby on rails…  
Please suggest me how i can use Newsletter extension…

Thanx for all in adv

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 8, 2008, 10:58am UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/12 "2008-01-08T10:58:17Z")

</div>

> Well, yes. Clients seem to be pretty happy about knowing how many of  
> the recpients has actually opened the newsletter, and how many of them  
> clicks the links in it. It just a call to a controller returning a 1x1  
> transparent pixel ([Web beacon - Wikipedia](http://en.wikipedia.org/wiki/Web_beacons)).

If you think that this functionality is closed related to a newsletter  
we  
can add it!Otherwise you can create a separated controller or extension  
to  
track all these kind of statistics.  
What do you think?

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 30, 2008, 7:31am UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/13 "2008-01-30T07:31:37Z")

</div>

Thanx Andrea…

Iam installed radiant cms and developed web application upto here  
every thing is okay… and now iam facing problem in adding newsletter  
feature to my application…i have done all commands which are below  
mentioned…  
it is created one page, called newsletter where it shows all the field  
tags…  
but when iam trying to execute  
“[http://localhost:3000/newsletter/newsletter\_logs/](http://localhost:3000/newsletter/newsletter_logs/)” with this url… am  
getting “File not found”

but when iam trying to execute “[http://localhost:3000/newsletter](http://localhost:3000/newsletter)”  
getting “This is newsletter page”… i knw which page and which tab is  
executed…

But my intension is to showing up all the information reg the  
newsletters in that page…

it is nice when we execute the cmd rake RAILS\_ENV=production  
radiant:extensions:newsletter:page:new… creates a new page…

Plz suggest me asap

> Hi Sridhar, you need to create a site with radiant. After installing it  
> check out the newsletter extension with subversion inside the  
> vendor/extensions directory.  
> Now, from the radiant root type the following commands:
> 
> rake RAILS\_ENV=production radiant:extensions:newsletter:install  
> rake RAILS\_ENV=production radiant:extensions:newsletter:page:new
> 
> Edit the environment.rb adding smtp settings. There is an example in the  
> README file of the extension.  
> Restart the server, and configure your newsletter editing the newsletter  
> page. Add a child page, save it and send it.  
> Let me know if you have any problems.
> 
> –  
> Andrea F.  
> [http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)

---

<div class="post-metadata">

**Author:** ![gendag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f04885/32.png) [@gendag](https://www.ruby-forum.com/u/gendag)\
**Post date:** [January 29, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/newsletter-extension-0-1-0/125016/14 "2008-01-29T15:07:51Z")

</div>

On Jan 28, 2008 8:19 AM, Sridhar G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi to all…
> 
> Am newbie to RoR and Radiant CMS…  
> I want to use newsletter extension in my application which is developed  
> in ruby on rails…  
> Please suggest me how i can use Newsletter extension…

Hi Sridhar, you need to create a site with radiant. After installing it  
check out the newsletter extension with subversion inside the  
vendor/extensions directory.  
Now, from the radiant root type the following commands:

rake RAILS\_ENV=production radiant:extensions:newsletter:install  
rake RAILS\_ENV=production radiant:extensions:newsletter:page:new

Edit the environment.rb adding smtp settings. There is an example in the  
README file of the extension.  
Restart the server, and configure your newsletter editing the newsletter  
page. Add a child page, save it and send it.  
Let me know if you have any problems.

–  
Andrea F.  
[http://gravityblast.com](http://gravityblast.com) - [http://nimboo.net](http://nimboo.net)
