Hi,

I've installed Simplenews module to sen newsletter. I would like to add a default content in the body box we find when we create a new newsletter issue (www.mydomain.com/node/add/simplenews) so the admin of the site will always find this deault content and will start to fill contents on it. Is it possible to do this??

Thanks in advance!

Comments

fmjrey’s picture

I just happened to see your question after stumbling upon this interesting article which I also quote below:

http://mrsimonelliott.com/blog/simplenews-creating-news-letters-using-vi...

The solution was to provide default content to the content type 'newsletter' every time a new newsletter was created.
You can't add a default value to the standard body field, so that was disabled and a replacement text area field was added using CCK.
When you add a new CCK field you are presented with options depending on the type of CCK field.
The text field allows you to use php code to generate a default value for your field.
Adding the following code fetched the full html output of the view created earlier and inserts it into your text area.

$viewName = 'nodequeue_1'; // nodequeue_1 = name of view I want added.
      return array(
          0 => array('value' => views_embed_view($viewName)),
);

So almost there, try it out. You'll see that if you add some posts to your NodeQueue and then create a new newsletter those post (or fields you have selected in your view config) will be added to your newsletter.

charlie-s’s picture

Thanks for the suggestion, a default CCK field sounds like the way to go.