Skip to content

Add Outcome email for visit#652

Merged
tarunnjoshi merged 6 commits intodevelopfrom
add-urban-outcome-cron
Dec 20, 2024
Merged

Add Outcome email for visit#652
tarunnjoshi merged 6 commits intodevelopfrom
add-urban-outcome-cron

Conversation

@tarunnjoshi
Copy link
Copy Markdown
Member

@tarunnjoshi tarunnjoshi commented Dec 19, 2024

Add Outcome email for visit

Summary by CodeRabbit

  • New Features

    • Introduced a service for sending outcome emails related to urban planned visits.
    • Added an API endpoint for processing urban planned visit outcomes.
  • Bug Fixes

    • Implemented error handling for missing email addresses when sending outcome emails.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 19, 2024

Warning

Rate limit exceeded

@tarunnjoshi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a4972b5 and aaa3f79.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php (1 hunks)

Walkthrough

This pull request introduces two new PHP files in the CiviCRM extension: UrbanPlannedVisitService.php and UrbanPlannedVisitOutcomeCron.php. The implementation focuses on creating a service for managing urban planned visit outcomes, specifically automating the process of sending outcome emails for visits that have been completed. The code provides a mechanism to retrieve visit information, identify the coordinating point of contact, and send personalized email notifications.

Changes

File Change Summary
wp-content/civi-extensions/goonjcustom/Civi/UrbanPlannedVisitService.php Added new service class with methods for sending outcome emails, including email generation and sending logic.
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php Added new API endpoint for processing urban planned visit outcomes, implementing a cron job to send emails for completed visits.

Possibly related PRs

  • Collection camp outcome reminder #343: The CollectionCampOutcomeService class and its methods for sending reminder emails are conceptually similar to the UrbanPlannedVisitService class, which also handles sending emails related to visits.
  • Volunteer camp feedback reminder #349: The CollectionCampVolunteerFeedbackService class, which manages sending feedback reminder emails, shares a similar functionality with the UrbanPlannedVisitService in terms of email handling and event processing.
  • Reminder for outcome 2 emails will be sent #392: The modifications to the processCampReminder method in the CollectionCampOutcomeService class relate to the email reminder logic, which is also a core function of the UrbanPlannedVisitService.
  • Send Feedback Email When Dropping Center is Closed or sent every 6 month #393: The DroppingCenterFeedbackService class, which manages feedback emails, has a similar structure and purpose to the UrbanPlannedVisitService, focusing on sending emails based on specific triggers.

Suggested labels

status : ready for review

Suggested reviewers

  • pokhiii

Poem

🌍 Urban visits, emails take flight,
Connecting dots with digital might,
Cron jobs dancing, messages clear,
Outcomes shared without a fear,
Technology's embrace, so bright! 📧


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (1)
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php (1)

3-21: Enhance API documentation for better maintainability

The documentation should provide more context about:

  • The purpose and frequency of this cron job
  • Expected behavior and side effects
  • Potential exceptions that might be thrown
 /**
  * Goonjcustom.UrbanPlannedVisitOutcomeCron API specification (optional)
  * This is used for documentation and validation.
+ * 
+ * This cron job processes urban planned visits that have occurred up to the current day
+ * and sends outcome emails to the coordinating POCs.
  *
  * @param array $spec
  *   description of fields supported by this API call.
  *
+ * @throws \Exception When email sending fails
  *
  * @return void
  */
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4241b1f and af1fa06.

📒 Files selected for processing (2)
  • wp-content/civi-extensions/goonjcustom/Civi/UrbanPlannedVisitService.php (1 hunks)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php (1 hunks)

->addWhere('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', '<=', $endOfDay)
->execute();

error_log("institutionVisit: " . print_r($institutionVisit, TRUE));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace error_log with CiviCRM logging

Using error_log for debugging in production code is not recommended. Use CiviCRM's logging system consistently.

-  error_log("institutionVisit: " . print_r($institutionVisit, TRUE));
+  \Civi::log()->debug('Processing institution visits', [
+    'visits' => $institutionVisit,
+  ]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
error_log("institutionVisit: " . print_r($institutionVisit, TRUE));
\Civi::log()->debug('Processing institution visits', [
'visits' => $institutionVisit,
]);

Comment on lines +49 to +58
foreach ($institutionVisit as $visit) {
try {
UrbanPlannedVisitService::sendOutcomeEmail($visit);
}
catch (\Exception $e) {
\Civi::log()->info('Error processing visit', [
'error' => $e->getMessage(),
]);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add visit processing status tracking

The cron job should track which visits have been processed to prevent duplicate emails.

Consider adding a status field to track processed visits:

   foreach ($institutionVisit as $visit) {
     try {
+      // Check if already processed
+      if ($visit['Urban_Planned_Visit.outcome_email_sent'] ?? false) {
+        continue;
+      }
       UrbanPlannedVisitService::sendOutcomeEmail($visit);
+      // Mark as processed
+      EckEntity::update('Institution_Visit', FALSE)
+        ->addValue('Urban_Planned_Visit.outcome_email_sent', true)
+        ->addWhere('id', '=', $visit['id'])
+        ->execute();
     }
     catch (\Exception $e) {
       \Civi::log()->info('Error processing visit', [
         'error' => $e->getMessage(),
+        'visit_id' => $visit['id'],
       ]);
     }
   }

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +41 to +46
$institutionVisit = EckEntity::get('Institution_Visit', FALSE)
->addSelect('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', 'Urban_Planned_Visit.Coordinating_Goonj_POC')
->addWhere('Urban_Planned_Visit.Coordinating_Goonj_POC', 'IS NOT NULL')
->addWhere('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', '<=', $endOfDay)
->execute();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add pagination to prevent timeout on large datasets

The query fetches all matching visits without any limit, which could cause performance issues or timeouts if there are many visits.

   $institutionVisit = EckEntity::get('Institution_Visit', FALSE)
     ->addSelect('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', 'Urban_Planned_Visit.Coordinating_Goonj_POC')
     ->addWhere('Urban_Planned_Visit.Coordinating_Goonj_POC', 'IS NOT NULL')
     ->addWhere('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', '<=', $endOfDay)
+    ->setLimit(50)  // Process in batches
     ->execute();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$institutionVisit = EckEntity::get('Institution_Visit', FALSE)
->addSelect('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', 'Urban_Planned_Visit.Coordinating_Goonj_POC')
->addWhere('Urban_Planned_Visit.Coordinating_Goonj_POC', 'IS NOT NULL')
->addWhere('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', '<=', $endOfDay)
->execute();
$institutionVisit = EckEntity::get('Institution_Visit', FALSE)
->addSelect('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', 'Urban_Planned_Visit.Coordinating_Goonj_POC')
->addWhere('Urban_Planned_Visit.Coordinating_Goonj_POC', 'IS NOT NULL')
->addWhere('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', '<=', $endOfDay)
->setLimit(50) // Process in batches
->execute();

Comment on lines +63 to +78
private static function getOutcomeEmailHtml($coordinatingGoonjPOCName) {
$homeUrl = \CRM_Utils_System::baseCMSURL();
$visitOutcomeFormUrl = $homeUrl . '/visit-outcome-form/';

$html = "
<p>Dear $coordinatingGoonjPOCName,</p>
<p>Thank you for attending the visit. Please fills out the below form:</p>
<ol>
<li><a href=\"$visitOutcomeFormUrl\">Camp Outcome Form</a><br>
This feedback form should be filled out after the camp/drive ends, once you have an overview of the event's outcomes.</li>
</ol>
<p>We appreciate your cooperation.</p>
<p>Warm Regards,<br>Urban Relations Team</p>";

return $html;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use CiviCRM's message template system

Instead of hardcoding the email HTML, use CiviCRM's message template system for better maintainability and consistency.

Consider:

  1. Creating a message template in CiviCRM
  2. Using token replacement for dynamic content
  3. Supporting multilingual content

Example implementation:

private static function getOutcomeEmailHtml($coordinatingGoonjPOCName) {
  $template = \CRM_Core_Smarty::singleton();
  $template->assign('coordinatingGoonjPOCName', $coordinatingGoonjPOCName);
  $template->assign('visitOutcomeFormUrl', 
    \CRM_Utils_System::baseCMSURL() . '/visit-outcome-form/');
  
  return $template->fetch('string:' . \CRM_Core_DAO::getFieldValue(
    'CRM_Core_DAO_MessageTemplate',
    'urban_planned_visit_outcome',
    'msg_html',
    'msg_title'
  ));
}

Comment on lines +41 to +43
error_log("coordinatingGoonjPOCEmail: " . print_r($coordinatingGoonjPOCEmail, TRUE));
error_log("coordinatingGoonjPOCName: " . print_r($coordinatingGoonjPOCName, TRUE));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace error_log with CiviCRM logging

Similar to the cron file, replace error_log with CiviCRM's logging system.

-    error_log("coordinatingGoonjPOCEmail: " . print_r($coordinatingGoonjPOCEmail, TRUE));
-    error_log("coordinatingGoonjPOCName: " . print_r($coordinatingGoonjPOCName, TRUE));
+    \Civi::log()->debug('Sending outcome email', [
+      'poc_email' => $coordinatingGoonjPOCEmail,
+      'poc_name' => $coordinatingGoonjPOCName,
+    ]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
error_log("coordinatingGoonjPOCEmail: " . print_r($coordinatingGoonjPOCEmail, TRUE));
error_log("coordinatingGoonjPOCName: " . print_r($coordinatingGoonjPOCName, TRUE));
\Civi::log()->debug('Sending outcome email', [
'poc_email' => $coordinatingGoonjPOCEmail,
'poc_name' => $coordinatingGoonjPOCName,
]);

Comment on lines +12 to +14
class UrbanPlannedVisitService extends AutoSubscriber {
private static $individualId = NULL;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Review class architecture and remove unused code

The class extends AutoSubscriber but doesn't seem to use its features. Also, there's an unused private static property.

  • Consider if extending AutoSubscriber is necessary
  • Remove the unused $individualId property unless it's planned for future use
-class UrbanPlannedVisitService extends AutoSubscriber {
-  private static $individualId = NULL;
+class UrbanPlannedVisitService {

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +30 to +47
public static function sendOutcomeEmail($visit) {
$coordinatingGoonjPOCId = $visit['Urban_Planned_Visit.Coordinating_Goonj_POC'];

$coordinatingGoonjPOC = Contact::get(FALSE)
->addSelect('email.email', 'display_name')
->addJoin('Email AS email', 'LEFT')
->addWhere('id', '=', $coordinatingGoonjPOCId)
->execute()->single();

$coordinatingGoonjPOCEmail = $coordinatingGoonjPOC['email.email'];
$coordinatingGoonjPOCName = $coordinatingGoonjPOC['display_name'];
error_log("coordinatingGoonjPOCEmail: " . print_r($coordinatingGoonjPOCEmail, TRUE));
error_log("coordinatingGoonjPOCName: " . print_r($coordinatingGoonjPOCName, TRUE));

if (!$coordinatingGoonjPOCEmail) {
throw new \Exception('POC email missing');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve error handling and data validation

The current error handling could be more robust with better validation and error messages.

   public static function sendOutcomeEmail($visit) {
+    // Validate visit data structure
+    if (!isset($visit['Urban_Planned_Visit.Coordinating_Goonj_POC'])) {
+      throw new \Exception('Invalid visit data: missing Coordinating_Goonj_POC');
+    }
+
     $coordinatingGoonjPOCId = $visit['Urban_Planned_Visit.Coordinating_Goonj_POC'];
+    if (!$coordinatingGoonjPOCId) {
+      throw new \Exception('Invalid visit data: Coordinating_Goonj_POC is empty');
+    }

     $coordinatingGoonjPOC = Contact::get(FALSE)
       ->addSelect('email.email', 'display_name')
       ->addJoin('Email AS email', 'LEFT')
       ->addWhere('id', '=', $coordinatingGoonjPOCId)
       ->execute()->single();

+    if (!$coordinatingGoonjPOC) {
+      throw new \Exception(
+        sprintf('Contact not found for POC ID: %d', $coordinatingGoonjPOCId)
+      );
+    }

     $coordinatingGoonjPOCEmail = $coordinatingGoonjPOC['email.email'];
     $coordinatingGoonjPOCName = $coordinatingGoonjPOC['display_name'];

     if (!$coordinatingGoonjPOCEmail) {
-      throw new \Exception('POC email missing');
+      throw new \Exception(
+        sprintf('Email missing for POC: %s (ID: %d)',
+          $coordinatingGoonjPOCName,
+          $coordinatingGoonjPOCId
+        )
+      );
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static function sendOutcomeEmail($visit) {
$coordinatingGoonjPOCId = $visit['Urban_Planned_Visit.Coordinating_Goonj_POC'];
$coordinatingGoonjPOC = Contact::get(FALSE)
->addSelect('email.email', 'display_name')
->addJoin('Email AS email', 'LEFT')
->addWhere('id', '=', $coordinatingGoonjPOCId)
->execute()->single();
$coordinatingGoonjPOCEmail = $coordinatingGoonjPOC['email.email'];
$coordinatingGoonjPOCName = $coordinatingGoonjPOC['display_name'];
error_log("coordinatingGoonjPOCEmail: " . print_r($coordinatingGoonjPOCEmail, TRUE));
error_log("coordinatingGoonjPOCName: " . print_r($coordinatingGoonjPOCName, TRUE));
if (!$coordinatingGoonjPOCEmail) {
throw new \Exception('POC email missing');
}
public static function sendOutcomeEmail($visit) {
// Validate visit data structure
if (!isset($visit['Urban_Planned_Visit.Coordinating_Goonj_POC'])) {
throw new \Exception('Invalid visit data: missing Coordinating_Goonj_POC');
}
$coordinatingGoonjPOCId = $visit['Urban_Planned_Visit.Coordinating_Goonj_POC'];
if (!$coordinatingGoonjPOCId) {
throw new \Exception('Invalid visit data: Coordinating_Goonj_POC is empty');
}
$coordinatingGoonjPOC = Contact::get(FALSE)
->addSelect('email.email', 'display_name')
->addJoin('Email AS email', 'LEFT')
->addWhere('id', '=', $coordinatingGoonjPOCId)
->execute()->single();
if (!$coordinatingGoonjPOC) {
throw new \Exception(
sprintf('Contact not found for POC ID: %d', $coordinatingGoonjPOCId)
);
}
$coordinatingGoonjPOCEmail = $coordinatingGoonjPOC['email.email'];
$coordinatingGoonjPOCName = $coordinatingGoonjPOC['display_name'];
error_log("coordinatingGoonjPOCEmail: " . print_r($coordinatingGoonjPOCEmail, TRUE));
error_log("coordinatingGoonjPOCName: " . print_r($coordinatingGoonjPOCName, TRUE));
if (!$coordinatingGoonjPOCEmail) {
throw new \Exception(
sprintf('Email missing for POC: %s (ID: %d)',
$coordinatingGoonjPOCName,
$coordinatingGoonjPOCId
)
);
}

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php (1)

64-64: Return meaningful data for debugging or monitoring.
Currently, $returnValues is always empty. Consider including the number of emails sent or any relevant status details. This makes monitoring results simpler and enables better troubleshooting if issues arise.

Example:

 $sentCount = 0;
 ...
 foreach ($institutionVisit as $visit) {
   try {
     UrbanPlannedVisitService::sendOutcomeEmail($visit);
+    $sentCount++;
   }
   catch (\Exception $e) {
     ...
   }
 }
 ...
 return civicrm_api3_create_success(['emailsSent' => $sentCount], $params, 'Goonjcustom', 'urban_planned_visit_outcome_cron');
wp-content/civi-extensions/goonjcustom/Civi/UrbanPlannedVisitService.php (2)

13-13: Assess necessity of extending AutoSubscriber.
If none of the AutoSubscriber functionalities are leveraged, consider removing this inheritance for a more streamlined design.


73-80: Fix grammatical error in the email body.
“Please fills out the below form” should be “Please fill out the form below” to improve readability and professionalism.

Possible fix:

-<p>. Please fills out the below form:</p>
+<p>Please fill out the form below:</p>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e560b0 and 20dd40c.

📒 Files selected for processing (2)
  • wp-content/civi-extensions/goonjcustom/Civi/UrbanPlannedVisitService.php (1 hunks)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php (1 hunks)
🔇 Additional comments (3)
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/UrbanPlannedVisitOutcomeCron.php (2)

51-51: Replace error_log with CiviCRM logging.


41-49: 🛠️ Refactor suggestion

Consider pagination to avoid potential timeouts.
When fetching a large number of records, consider batching or applying limits to prevent timeouts and performance degradation. Handling these records in chunks ensures smoother operation and predictable resource usage.

Example implementation:

 $institutionVisit = EckEntity::get('Institution_Visit', FALSE)
   ->addSelect('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', 'Urban_Planned_Visit.Coordinating_Goonj_POC')
   ->addWhere('Urban_Planned_Visit.Coordinating_Goonj_POC', 'IS NOT NULL')
   ->addWhere('Urban_Planned_Visit.When_do_you_wish_to_visit_Goonj', '<=', $endOfDay)
   ->addClause('OR',
       ['Visit_Outcome.Outcome_Email_Sent', 'IS NULL'],
       ['Visit_Outcome.Outcome_Email_Sent', '=', 0]
   )
+  ->setLimit(50)
   ->execute();

Likely invalid or redundant comment.

wp-content/civi-extensions/goonjcustom/Civi/UrbanPlannedVisitService.php (1)

43-44: Use CiviCRM logging system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants