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) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • How to fix OptOutUrl
Pages: [1]

Author Topic: How to fix OptOutUrl  (Read 1910 times)

jeff porter

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 2
How to fix OptOutUrl
April 03, 2010, 07:06:30 am
I am sure this is an easy one for some of you, but where can I edit the OptOutURL or affect how it is constructed?  Here is what is getting generated:

<a href="http://http://dev.fpwr.org/civicrm/mailing/optout?reset=1&amp;jid=5&amp;qid=1097&amp;h=d5df6076c668fa3f" target="_blank">here</a>

1. I know that the HTML editor in civicrm is generating the first "http://" - so either the OptOutURL needs to drop the "http://" or the editor needs to.  However, for now, I can just edit the source and work around it.

2. The Bigger problem is that our site domain URL is not dev.fpwr.org, its www.fpwr.org  -  this is a problem as I don't want opt outs going to our dev site.  I have looked everywhere (including "Settings -> Update Directory Path and URL") and everything is pointing to www.fpwr.org.  So, where CiviMail getting this base_URL value?

THanks

Jeff
Jeff Porter
Foundation for Prader-Willi Research (www.fpwr.org)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to fix OptOutUrl
April 03, 2010, 01:28:19 pm
Jeff,

Check your Settings >> Resource Url

What's your CiviCRM version? What's your wysiwyg editor?

Kurund
Found this reply helpful? Support CiviCRM

jeff porter

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 2
Re: How to fix OptOutUrl
April 03, 2010, 01:49:27 pm
Resource URL:  http://www.fpwr.org/sites/all/modules/civicrm/
WYSIWYG: CKEditor
CiviCRM version: 3.1.3
Jeff Porter
Foundation for Prader-Willi Research (www.fpwr.org)

jeff porter

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 2
Re: How to fix OptOutUrl
April 06, 2010, 07:01:25 am
Any ideas where civimail is pulling dev.fpwr.org from?
Jeff Porter
Foundation for Prader-Willi Research (www.fpwr.org)

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to fix OptOutUrl
April 06, 2010, 07:07:30 am
The optOutUrl token’s URL is constructed in CRM_Mailing_BAO_Mailing::getVerpAndUrlsAndHeaders() – but this uses the generic CRM_Utils_System::url() call, so my guess is that for some reason it’s picking up the wrong civicrm.settings.php file (or the wrong config values) for some reason.

You can try debugging it by checking the value there.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to fix OptOutUrl
April 06, 2010, 08:05:11 am
What is the url you call to run the cronjob ?


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

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: How to fix OptOutUrl
April 08, 2010, 08:46:01 am
I'm having problem with the OptOutUrl as well (Drupal 6.15/CiviCRM 3.03)

{action.optOutUrl} outputs:
http://www.mydomainname.com/index.php?q=/civicrm/mailing/optout&reset=1&jid=20&qid=109&h=f2e0a261ef2e8f50

but it should be
http://www.mydomainname.com/civicrm/mailing/optout&reset=1&jid=20&qid=109&h=f2e0a261ef2e8f50

Because I have drupal clean url enabled and looking from the civicrm.settings.php

Code: [Select]
if ( function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) {
    define( 'CIVICRM_CLEANURL', 1 );
} else {
    define( 'CIVICRM_CLEANURL', 0 );
}

My clean_url value is 1 from the drupal variable table and I went through all the administrator console and do not see where else I can change the link structure

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to fix OptOutUrl
April 09, 2010, 04:48:17 am
Quote from: xcf33 on April 08, 2010, 08:46:01 am
My clean_url value is 1 from the drupal variable table and I went through all the administrator console and do not see where else I can change the link structure

Can you check in your CRM/Core/Config.php file whether it picks up the right cleanURL value?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

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: How to fix OptOutUrl
April 09, 2010, 11:43:57 am
In the CRM/Core/Config.php file this is where the script initializes the cleanURL

Code: [Select]
// this is dynamically figured out in the civicrm.settings.php file
        if ( defined( 'CIVICRM_CLEANURL' ) ) {       
            $this->cleanURL = CIVICRM_CLEANURL;
        } else {
            $this->cleanURL = 0;
        }

I even set $this->cleanURL = 1 in the if else statement and sent out another mailing, the opt-out link remains with the 'q' query variable.


Another interesting fact is the token outputs the opt-out ink correctly in the test email in the clean url format. However, it retains the the use of 'q=' in the real mailing



Thanks




Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to fix OptOutUrl
April 13, 2010, 04:37:18 pm
Quote from: xcf33 on April 09, 2010, 11:43:57 am
In the CRM/Core/Config.php file this is where the script initializes the cleanURL

Code: [Select]
// this is dynamically figured out in the civicrm.settings.php file
        if ( defined( 'CIVICRM_CLEANURL' ) ) {       
            $this->cleanURL = CIVICRM_CLEANURL;
        } else {
            $this->cleanURL = 0;
        }

I even set $this->cleanURL = 1 in the if else statement and sent out another mailing, the opt-out link remains with the 'q' query variable.

You can try adding $this->cleanURL = 1; after the closing curly brace just in case, but…

Quote
Another interesting fact is the token outputs the opt-out ink correctly in the test email in the clean url format. However, it retains the the use of 'q=' in the real mailing

…this suggests that the problem lies elsewhere – apparently, the ‘real’ mailing uses another config.

If the test works from the wizard, can you try triggering the pending mailings by visitng the …civicrm/mailing/queue?reset=1 URL? This should use the same config that the test uses.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • How to fix OptOutUrl

This forum was archived on 2017-11-26.