Answers.Body: <p>A while ago SYSTOPIA and (mainly) Rich (artfulrobot) built two extensions that aimed at collecting external content and storing it in CiviCRM (<a href="https://github.com/systopia/de.systopia.newsstore" rel="nofollow noreferrer">newsstore</a>) as well as one extension (<a href="https://github.com/systopia/de.systopia.newsstoremailer" rel="nofollow noreferrer">NewsStore Mailer</a>) which allows to create regular mailings with pre-defined templates that use those &quot;content items&quot;.</p>
  <p>The use case sounds very similar to what you have in mind. Unfortunately, the customer decided to not use the feature before we were able to fully test / finalize it. There may be incompatibilities with current CiviCRM versions, too.</p>
  <p>However, they may be wort a look as a lot of work went into those and it looked very promising. Would love to see those used.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-30T09:24:17.063Z
Answers.LastActivityDate: 2023-10-30T09:24:17.063Z
Answers.UserDisplayName: Fabian
Body: <p>A specific client sends out a newsletter every month. It contains a selection of articles from their website and a list of upcoming events.</p>
  <p>Ideally, I would like to develop an extension that generates every month a draft Mosaico mailing with the content of the month.</p>
  <p>Staff can then edit this newsletter using Mosaico (e.g. correct a title that's too long, remove/add an article manually...) and send out the mailing.</p>
  <p>I see that the table civicrm_mailing contains a column template_options with JSON and that the property &quot;mainBlocks&quot; contains an array of blocks.</p>
  <p>I could reverse engineer an existing template, but I was wondering if there is an API or a bunch of classes to create a Mosaico message?</p>
  
Tags: <mosaico>
Title: How to generate a Mosaico mailing?
ThreadText: # How to generate a Mosaico mailing?
  
  (Asked by: username_0 on 2023-10-27)
  
  A specific client sends out a newsletter every month. It contains a selection of articles from their website and a list of upcoming events.
  
  Ideally, I would like to develop an extension that generates every month a draft Mosaico mailing with the content of the month.
  
  Staff can then edit this newsletter using Mosaico (e.g. correct a title that's too long, remove/add an article manually...) and send out the mailing.
  
  I see that the table civicrm\_mailing contains a column template\_options with JSON and that the property "mainBlocks" contains an array of blocks.
  
  I could reverse engineer an existing template, but I was wondering if there is an API or a bunch of classes to create a Mosaico message?
  
  **Tags:** mosaico
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-10-30. Score: 1
  
  A while ago SYSTOPIA and (mainly) Rich (artfulrobot) built two extensions that aimed at collecting external content and storing it in CiviCRM ([newsstore](https://github.com/systopia/de.systopia.newsstore)) as well as one extension ([NewsStore Mailer](https://github.com/systopia/de.systopia.newsstoremailer)) which allows to create regular mailings with pre-defined templates that use those "content items".
  
  The use case sounds very similar to what you have in mind. Unfortunately, the customer decided to not use the feature before we were able to fully test / finalize it. There may be incompatibilities with current CiviCRM versions, too.
  
  However, they may be wort a look as a lot of work went into those and it looked very promising. Would love to see those used.
  
  
  ---
  
  