Answers.Body: <p>Harshal,</p>
  
  <p>Check the resource url is set properly. Navigate to CiviCRM >> Administer >> System Settings >> Resource URLS. Click on '?' to see if all the variables have correct values and are pointing to right directories. If not then you may need to update the civicrm.settings.php file for $civicrm_root variable until the you get th variables right in resource url.</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T17:47:34.163Z
Answers.Text: Hi I am using a symlink , can that be an issue, apart from that , I dont see the resource url to be havng any issue, i have updated my question,kindly have a look at and provide your valuable feedback.
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T17:49:43.593Z
Answers.Text: I am taking about RESOURCE URL not the directory path. Yes sometimes symlink is problem. Is you resource url have correct path?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T17:55:46.360Z
Answers.Text: how can I debug and find the issue ?
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T17:56:33.450Z
Answers.Text: can you add the resource url variables into your post?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T17:59:03.047Z
Answers.Text: Hi i have added resource url variables, kindly have a look at it
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T18:02:18.480Z
Answers.Text: Looks good. Not sure why its doing that. Probably the url is not set during cron run. Which method are you using for cron?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T18:07:27.390Z
Answers.Text: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/83954/discussion-between-harshal-and-pradeep-nayak).
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-02T17:30:35.953Z
Answers.LastActivityDate: 2018-10-02T17:30:35.953Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Drupal Version:7.59<br>
  CiviCRM Version:5.3.1<br>
  I am facing an error of incorrect Links in Emails sent via scheduled mailings.
  <br>
  The HTML is</p>
  
  <pre><code>&lt;a href="https://example.com/sites/example2.com/files/abc.pdf"&gt;Test&lt;/a&gt;
  </code></pre>
  
  <p>1) When mail is sent manually by selecting <strong>Execute Now</strong>
  <a href="https://i.sstatic.net/eXrV0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eXrV0.png" alt="enter image description here"></a></p>
  
  <p>the links for the pdf works perfectly<br></p>
  
  <p>2) When it runs via cron 
  the link generated is this
  /usr/share/nginx/abc/sites/all/modules/civicrm/extern/url.php?u=2937&amp;qid=34399</p>
  
  <p>I need to debug on both #1 and #2, what can be the appropriate files to debug and what can be the process to debug?</p>
  
  <p>I am having a <strong>symlink</strong> so in 
  <br>Settings - Upload Directories<br>
  <br>[cms.root]  <br>/usr/share/nginx/abc
  <br>[civicrm.root]<br>  /usr/share/nginx/abc/sites/all/modules/civicrm<br>
  <br>[civicrm.files]<br> /usr/share/nginx/abc/sites/default/files/civicrm<br></p>
  
  <p>Resource URL <br>
  <br>
  [cms.root]  <br>
  <a href="https://example.com/" rel="nofollow noreferrer">https://example.com/</a><br>
  [civicrm.root]  <br>
  <a href="https://example.com/sites/all/modules/civicrm/" rel="nofollow noreferrer">https://example.com/sites/all/modules/civicrm/</a><br>
  [civicrm.files]<br>
      <a href="https://example.com/sites/example2.com/files/civicrm/" rel="nofollow noreferrer">https://example.com/sites/example2.com/files/civicrm/</a><br></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-02T16:43:41.733Z
Comments.Text: It appears as though you have link tracking enabled for your mailing - that's the general format that tracked links follow (except of course for being a relative link and not absolute).  Are you using Mosaico by chance?  Are you using any kind of third party sending tool (e.g., SendGrid, Sparkpost)?
Comments.UserDisplayName: Lesley Carter - BackOffice
Tags: <scheduled-job>
Title: How to debug the API Action process_mailing?
ThreadText: # How to debug the API Action process_mailing?
  
  (Asked by: username_0 on 2018-10-02)
  
  Drupal Version:7.59  
  CiviCRM Version:5.3.1  
  I am facing an error of incorrect Links in Emails sent via scheduled mailings.
    
  The HTML is
  
  ```
  <a href="https://example.com/sites/example2.com/files/abc.pdf">Test</a>
  
  ```
  
  1) When mail is sent manually by selecting **Execute Now**
  [![enter image description here](https://i.sstatic.net/eXrV0.png)](https://i.sstatic.net/eXrV0.png)
  
  the links for the pdf works perfectly
  
  2) When it runs via cron
  the link generated is this
  /usr/share/nginx/abc/sites/all/modules/civicrm/extern/url.php?u=2937&qid=34399
  
  I need to debug on both #1 and #2, what can be the appropriate files to debug and what can be the process to debug?
  
  I am having a **symlink** so in
    
  Settings - Upload Directories  
    
  [cms.root]   
  /usr/share/nginx/abc
    
  [civicrm.root]  
   /usr/share/nginx/abc/sites/all/modules/civicrm  
    
  [civicrm.files]  
   /usr/share/nginx/abc/sites/default/files/civicrm
  
  Resource URL   
    
  [cms.root]   
  <https://example.com/>  
  [civicrm.root]   
  <https://example.com/sites/all/modules/civicrm/>  
  [civicrm.files]  
  <https://example.com/sites/example2.com/files/civicrm/>
  
  **Tags:** scheduled-job
  
  > **Comments:**
  > **username_1**: It appears as though you have link tracking enabled for your mailing - that's the general format that tracked links follow (except of course for being a relative link and not absolute).  Are you using Mosaico by chance?  Are you using any kind of third party sending tool (e.g., SendGrid, Sparkpost)?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-10-02. Score: 1
  
  username_0,
  
  Check the resource url is set properly. Navigate to CiviCRM >> Administer >> System Settings >> Resource URLS. Click on '?' to see if all the variables have correct values and are pointing to right directories. If not then you may need to update the civicrm.settings.php file for $civicrm\_root variable until the you get th variables right in resource url.
  
  HTH
  
  username_2
  
  > **Comments:**
  > **username_0**: Hi I am using a symlink , can that be an issue, apart from that , I dont see the resource url to be havng any issue, i have updated my question,kindly have a look at and provide your valuable feedback.  
  > **username_2**: I am taking about RESOURCE URL not the directory path. Yes sometimes symlink is problem. Is you resource url have correct path?  
  > **username_0**: how can I debug and find the issue ?  
  > **username_2**: can you add the resource url variables into your post?  
  > **username_0**: Hi i have added resource url variables, kindly have a look at it  
  > **username_2**: Looks good. Not sure why its doing that. Probably the url is not set during cron run. Which method are you using for cron?  
  > **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/83954/discussion-between-username_0-and-username_2).  
  
  ---
  
  