CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviMail permalink core changes
Pages: [1]

Author Topic: CiviMail permalink core changes  (Read 1033 times)

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
CiviMail permalink core changes
March 09, 2011, 09:11:59 am
Hi all, I'm working on an bulk mailing permalink (So that visitors can visit a page and view a bulk mailing). It also create some opportunity for social media integration (like, share, etc).

So I'm working with

CRM/Mailing/Page/View.php which corresponds to the url of http://www.example.com/civicrm/mailing/view?id=xx

I don't know what the original intention of the creator of the file is but I'd like to have the ability for anonymous visitors to view mailings that has been sent via just a permission (perhaps "access CiviMail subscribe/unsubscribe pages" or new permission).

To do so pretty much have to strip most of checkPermission(); out.



I'd like to seek comments/feedbacks (especially from the creator of the file) before I proceed.


Thanks,


Cheers!



xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviMail permalink core changes
March 09, 2011, 09:40:22 am
Hi,

Great! Thanks, that's been often requested.

I'm assuming it should be done on a per mailing basis (ie. not only public mailings are sent with civimail, some I'd definitely want to stay private).

IMO, would solve the problem to use the checksum token, eg.

You can read online this newsletter:
http://www.example.com/civicrm/mailing/view?id=xx&contact_id=yy&cs=zzz

Hence, if you don't publish the link with the checksum, it will stay protected.

Might need to bypass the check on the duration of the checksum (easy, the code is already there).

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail permalink core changes
March 09, 2011, 10:24:09 am

I would probably propose something easier and simpler:

* Introduce a new permission called : "view civimail content" (or something like that)
* if a "user" has the above permission AND the mailing has visibility public then show the mailing
* if a "user" has the above permission AND the mailing has visibily user and admin, AND the user received the mailing then show the mailing. In this case xavier's checksum idea should be implemented to avoid the user logging in
* if a "user" is an admin then the user can view all content

i think most installs will be in item 2 and hence a lot easier and avoids dealing with checksum for them

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: CiviMail permalink core changes
March 09, 2011, 10:58:16 am
One problem with mailing visibility though is that it is not in the CiviMail mailing process (No where to specify it).

Also, how do I introduce new permissions?

Lastly I'm interested in finding out about xavier's checksum idea.


Ping me in IRC.


Cheers!

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: CiviMail permalink core changes
March 09, 2011, 02:32:02 pm
Alright I have the following done:


added visibility settings in the bulk mailing process in step 1
added the new permission "view CiviMail content"

edited mailing/view so that right now

1. if mailing visibility is Public Pages and user has permission "view CiviMail content" then TRUE
2. if user has permission of "administer CiviCRM" or "access CiviMail" then TRUE


The difference is that if the user is anon (no contact record), the mailing content will not be personalized (with token stuff).

I have yet implemented the checksum stuff.


Cheers!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviMail permalink core changes
March 09, 2011, 03:12:58 pm
In step 1 ?

IMO, would fit better in the step 2 as a 3rd block "Online Publication"

Dave, you are the one able to translate so normal human beings can understand, what do you thing about where and how should be presented the "Mailing Visibility"

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMail permalink core changes
March 09, 2011, 05:18:34 pm
Maybe tweak the new permission title to: "view public CiviMail content"
(Since my understanding is that this permission only provides access to mailings with public visibility AND is not needed if the user is a recipient.)

Given the potentially large amount of content on page 1 (w/ include and exclude groups and prior mailings etc.) - I'd go with Xavier's suggestion for a 3rd fieldset "Online Publication" - on page 2. Field label could be:

"Mailing can be viewed online by": [ - select - ]

We might want to use more explicit option labels in the dropdown as well. Something like this:
Code: [Select]
<option value="Public">Anyone with "view public CiviMail content permission"</option>
<option value="User and Admin">Recipients and users with "access CiviMail" permission</option>


(Above seems clear but maybe to wordy? thoughts?)

This is an exciting and much needed new feature!!!
Protect your investment in CiviCRM by  becoming a Member!

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: CiviMail permalink core changes
March 10, 2011, 06:35:41 am
Thanks for the input Dave and Xavier,

I think both suggestions make sense,

The original thought I had was just go with the default select form element that was used throughout the platform for consistency. I believe I have the explanation in the help text.

Regardless I think I will move the visibility settings to the second page first.


Cheers!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • CiviMail permalink core changes

This forum was archived on 2017-11-26.