Hooking into CiviMail: supplying HTML and plain text programatically

View: New views
2 Messages — Rating Filter:   Alert me  

Hooking into CiviMail: supplying HTML and plain text programatically

by Benjamin Melançon-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

I've made a newsletter module that outputs an HTML e-mail and plain
text version of various nodes (or teasers of nodes) that are tagged
with the date off that issue.  I'll be happy to share the code with
anyone who wants it, though there's a lot of case-specific information
hardcoded in.

The question now, and I'd really appreciate if someone can hold my
hand through this because my brain's quit for a while, is how to
supply this information directly to CiviMail so that it doesn't have
to be copied and pasted into the send mailing fform.

Also we need a signup block that deals with adding people to the
newsletter group (or rather, sends an opt-in e-mail) without freaking
out if they happen to be in CiviCRM already.  But that's more of a
general CiviCRM question so I'll post it there.

The CiviMail question for the night remains:  how can a newsletter be
initiated programatically?  Not necessarily sent, but supplied with
its content?

- ben

Agaric Design Collective
Open Source Web Development
http://AgaricDesign.com/

People Who Give a Damn
building the infrastructure of a network for everyone
http://pwgd.org/
____________________________________________________________
You received this message as a subscriber on the list:
     civicrm-mail@...
To be removed from the list, send any message to:
     civicrm-mail-unsubscribe@...

For all list information and functions, see:
     http://lists.civicrm.org/lists/info/civicrm-mail

Re: Hooking into CiviMail: supplying HTML and plain text programatically

by Donald Lobo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

benj:

you'll have to hack the civimail wizard to accomplish the below. we
can help you out with this on IRC.

roughly the steps are:

1. create a url from the module to
q=civicrm/mailing/send?htmlID=XXX&textID=YYY&reset=1

2. in the wizard, store htmlID and textID in the session

3. in the compose mailing page, retrieve the above values from the
session, and use these values to call into your code to get the html
and text messages. Set these as default values in the form

so if 3 is simple, the rest are basically one line function calls in
the CiviCRM code files. You can contact me on IRC or GTalk and i can
walk u thru it

lobo

On 1/8/07, Benjamin Melançon <pwgdarchive@...> wrote:

> Hello all,
>
> I've made a newsletter module that outputs an HTML e-mail and plain
> text version of various nodes (or teasers of nodes) that are tagged
> with the date off that issue.  I'll be happy to share the code with
> anyone who wants it, though there's a lot of case-specific information
> hardcoded in.
>
> The question now, and I'd really appreciate if someone can hold my
> hand through this because my brain's quit for a while, is how to
> supply this information directly to CiviMail so that it doesn't have
> to be copied and pasted into the send mailing fform.
>
> Also we need a signup block that deals with adding people to the
> newsletter group (or rather, sends an opt-in e-mail) without freaking
> out if they happen to be in CiviCRM already.  But that's more of a
> general CiviCRM question so I'll post it there.
>
> The CiviMail question for the night remains:  how can a newsletter be
> initiated programatically?  Not necessarily sent, but supplied with
> its content?
>
> - ben
>
> Agaric Design Collective
> Open Source Web Development
> http://AgaricDesign.com/
>
> People Who Give a Damn
> building the infrastructure of a network for everyone
> http://pwgd.org/
> ____________________________________________________________
> You received this message as a subscriber on the list:
>      civicrm-mail@...
> To be removed from the list, send any message to:
>      civicrm-mail-unsubscribe@...
>
> For all list information and functions, see:
>      http://lists.civicrm.org/lists/info/civicrm-mail
>


--
lobo

http://civicrm.org/blog/
http://civicrm.org/
http://wiki.civicrm.org/
http://issues.civicrm.org/
____________________________________________________________
You received this message as a subscriber on the list:
     civicrm-mail@...
To be removed from the list, send any message to:
     civicrm-mail-unsubscribe@...

For all list information and functions, see:
     http://lists.civicrm.org/lists/info/civicrm-mail