Answers.Body: <p>We are having this problem as well, also in WordPress 4.9.2. We have discovered that the issue arises because permissions get corrupted. According to SiteGround, our host, these permissions in particular are problematic:</p>
  
  <ul>
  <li>./wp-content/uploads/civicrm/templates_c/en_US/%%31/313</li>
  <li>./wp-content/uploads/civicrm/templates_c/en_US/%%D6/D67</li>
  </ul>
  
  <p>We don't know what is causing permissions to break in the first place. For example, yesterday, we sent out three emails with trackable links within 1 hour. The first two worked perfectly. The last one didn't work - 'public_html' inserted into all the links.</p>
  
  <p>Our solution has been to create a cron job in cPanel to reset permissions every 5 minutes.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-09T15:37:50.307Z
Answers.Text: Most likely your permissions are incorrect because your cron job isn't running as the same user as your web server.  In VPS environments you can work around this but with shared hosting you generally can't.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-09T13:50:42.407Z
Answers.LastActivityDate: 2018-03-09T13:50:42.407Z
Answers.UserDisplayName: Michelle Rojas
Body: <p>When a TEST mailing is sent with tracking link clicks enabled, then the URL DOES NOT include "public_html/"; however, when the mailing is scheduled and sent with tracking link clicks, then "public_html/" is INSERTED into URL. </p>
  
  <p>Wordpress Version --> 4.9.2
  CIVICRM Version --> 4.7.27</p>
  
Tags: <mailing><scheduled-job>
Title: CIVICRM mailing links not working properly in schedule job
ThreadText: # CIVICRM mailing links not working properly in schedule job
  
  (Asked by: username_0 on 2018-01-23)
  
  When a TEST mailing is sent with tracking link clicks enabled, then the URL DOES NOT include "public\_html/"; however, when the mailing is scheduled and sent with tracking link clicks, then "public\_html/" is INSERTED into URL.
  
  Wordpress Version --> 4.9.2
  CIVICRM Version --> 4.7.27
  
  **Tags:** mailing, scheduled-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-03-09. Score: 2
  
  We are having this problem as well, also in WordPress 4.9.2. We have discovered that the issue arises because permissions get corrupted. According to SiteGround, our host, these permissions in particular are problematic:
  
  * ./wp-content/uploads/civicrm/templates\_c/en\_US/%%31/313
  * ./wp-content/uploads/civicrm/templates\_c/en\_US/%%D6/D67
  
  We don't know what is causing permissions to break in the first place. For example, yesterday, we sent out three emails with trackable links within 1 hour. The first two worked perfectly. The last one didn't work - 'public\_html' inserted into all the links.
  
  Our solution has been to create a cron job in cPanel to reset permissions every 5 minutes.
  
  > **Comments:**
  > **username_2**: Most likely your permissions are incorrect because your cron job isn't running as the same user as your web server.  In VPS environments you can work around this but with shared hosting you generally can't.  
  
  ---
  
  