Answers.Body: <p>Currently not possible without forking the <a href="https://github.com/craftcms/contact-form" rel="nofollow noreferrer">Contact Form plugin</a> and changing the logic to do what you're looking for.</p>
  
  <p>There are other form builder/contact form plugins that might have more options when dealing with SPAM you might want to look at as well: <a href="https://plugins.craftcms.com/search?q=contact%20form" rel="nofollow noreferrer">https://plugins.craftcms.com/search?q=contact%20form</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-12T18:19:15.940Z
Answers.Text: Thanks Brad, that's too bad about the spam flag but I'll look into the Form code. I did comb through the other contact plugins but my needs are pretty simple compared to what is out there. :)
Answers.UserDisplayName: Roger Wilco
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-11T18:30:35.960Z
Answers.LastActivityDate: 2020-03-11T18:30:35.960Z
Answers.UserDisplayName: Brad Bell
Body: <p>I've noticed all of my Contact Form spam has a referrer that matches the form's location. Building a module is out of my comfort zone for now (not really a developer). I am currently using the Honeypot plugin, though, so I have a simple conditional in my contact page which compares the referer to the URL and if it's the same, fills the Honeypot field with a value.</p>
  
  <p>The Honeypot plugin will set the <code>isSpam</code> flag to true, which prevents the message from being delivered. Then the form redirects to its default "Thank You" template.</p>
  
  <p>What I want is for this template to display a message that the submission was flagged as spam and not delivered. I can see that <code>/craft/vendor/craftcms/contact-form/src/Mailer.php</code> has code that sets a message when <code>isSpam</code> is set to <code>true</code>:</p>
  
  <pre><code>if ($event-&gt;isSpam) {
     Craft::warning('Contact form submission suspected to be spam.', __METHOD__);
     return true;
  }
  </code></pre>
  
  <p>…but for the life of me I can't find how to access <code>Craft::warning</code> or to have it output into a template. Any pointers are greatly appreciated. Thank you!</p>
  
Tags: <craft3><plugin-contactform>
Title: Where is this spam message sent using the Contact Form plugin?
ThreadText: # Where is this spam message sent using the Contact Form plugin?
  
  (Asked by: username_0 on 2020-03-09)
  
  I've noticed all of my Contact Form spam has a referrer that matches the form's location. Building a module is out of my comfort zone for now (not really a developer). I am currently using the Honeypot plugin, though, so I have a simple conditional in my contact page which compares the referer to the URL and if it's the same, fills the Honeypot field with a value.
  
  The Honeypot plugin will set the `isSpam` flag to true, which prevents the message from being delivered. Then the form redirects to its default "Thank You" template.
  
  What I want is for this template to display a message that the submission was flagged as spam and not delivered. I can see that `/craft/vendor/craftcms/contact-form/src/Mailer.php` has code that sets a message when `isSpam` is set to `true`:
  
  ```
  if ($event->isSpam) {
     Craft::warning('Contact form submission suspected to be spam.', __METHOD__);
     return true;
  }
  
  ```
  
  …but for the life of me I can't find how to access `Craft::warning` or to have it output into a template. Any pointers are greatly appreciated. Thank you!
  
  **Tags:** craft3, plugin-contactform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-03-11. Score: 1 | Accepted answer
  
  Currently not possible without forking the [Contact Form plugin](https://github.com/craftcms/contact-form) and changing the logic to do what you're looking for.
  
  There are other form builder/contact form plugins that might have more options when dealing with SPAM you might want to look at as well: <https://plugins.craftcms.com/search?q=contact%20form>
  
  > **Comments:**
  > **username_0**: Thanks username_1, that's too bad about the spam flag but I'll look into the Form code. I did comb through the other contact plugins but my needs are pretty simple compared to what is out there. :)  
  
  ---
  
  