To do this without coding will be difficult. Contact Form 7 is meant to send out emails after form submission, not much more. You need a callback function that you can use to implement your coupon logic.
One possible solution:
Install the Redirect Addon for Contact Form 7 and configure it to redirect to a local page, ie. “thankyou”. On this page, you could place a shortcode, which will provide you with the necessary callback function to retrieve a coupon code from the list and return it to the user.
Other than that, you could hook into wpcf7_before_send_mail, which has the benefit of being able to access the POST data (which will be gone after a redirect).
Yet another way would be to have your own shortcode within the mail body, ie. [coupon_code]. Here’s how you could use this to display the coupon code in the outgoing mail: https://wordpress.org/support/topic/custom-shortcode-in-emails/
Related Posts:
- Why do I get this “plugin does not have a valid header” error?
- A Blog’s changelog
- Adding a widget programmatically
- Template plugin for blog posts? [closed]
- How can I serve a text file at a custom URL
- How to add custom link to menu in wordpress programmatically?
- Add custom PHP and HTML to the_content()
- Securing a plugin pop-up window
- Call to undefined function add_action() in plugin
- Buddypress Member list not showing admin and mods
- SVN problem – commit taking forever to fix incomplete prior commit
- pluggable function in theme, to be overridden by plugin
- How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?
- Get value of a key from a Plugin Serialized array
- How to remove site name (https://exp.com/) from WORDPRESS site source links or file load url
- Update title field while listing wordpress page titles in Elementor selector
- How can I display custom snippet codes in the front end of my WordPress site
- Neither update_option nor delete_option fires in deactivation hook
- Custom wordpress plugin does not save select element
- Need help with wordpress audio preload
- Share or sync user table data with another user table
- Very slow page loads
- Can I merge all my JS and CSS in one file using WP?
- Allow direct access to files/folders within WordPress to replace wp-admin
- How to set meta-data for my plugin
- WordPress isn’t sending welcome email with the password reset
- WordPress Homepage Login
- How can I get the permalink of a page on which shortcode has been used
- How to put tags on photos in Windows that WordPress can read and apply on media files?
- List category-posts not work properly
- Auto-scroll to beginning of accordion item
- A splash page on landing page
- I cannot login after installing the wp-login timeout setting plugin
- True/False ACF field returning null by default even if default value is true
- Sanitizing, Validating , etc (Plugin)
- Add_rewrite_rule in HivePress (WordPress plugin/theme)
- Inline AJAX script passing variables to PHP
- How to get attributes from block.js into php
- How to customized post slider layout in elementor wordpress [closed]
- I’m getting the following error: Fatal error: Uncaught Error: Call to undefined function oil_paint_regeneration() [closed]
- Selectively override Easy Digital Downloads protection via filter
- How to export post tags from wordpress
- Plugin_Upgrader not working if function is called from remote server
- Show WooCommerce products based on query parameters on redirect
- how to code activate/deactive button of custom plugin within backend?
- move setting data from wordpress api to codestar freamwork
- How to access the page without registering in wordpress
- CPT template is not being automatically used single post pages
- How to trigger plugin migration code when plugin updates?
- How to Save Category and Delete Category in same Function
- Accessible ‘List Carousel’ block/pattern?
- claim a permalink and all sublinks in plugin
- Play an animated character video on click of a button or radio button selection only
- Vanilla javascript in custom gutenberg block not working
- Create CPT on Ajax Call
- Cannot register a block in my Twig-based theme using Timber for WP
- How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?
- add_action() not working for admin
- WordPress Plugin translation not working EN To FR
- Can’t change login logo & css – older plugin data blocking?
- Learnpress FATAL ERROR
- is_singular() in mu-plugins not working
- Error 400 Invalid “products[1].productId” Kinguin [closed]
- USPS shipping costs are being doubled when using the USPS shipping method plugin [closed]
- How to make a drop-down list so you can press and change display like on this website by using wordpress or CSS
- How to create new title and its description inside a section in WP Customizer?
- Issue: Unable to Access WordPress Admin and Database Errors
- I want to move the one click accesbility button on bottom of my website screen,
- WordPress : how to create onglet and remove it when only one
- Autocomplete search field that is feed by a taxonomy from custom post type?
- Plugins updates not showing on wordpress
- Unable to login – critical error
- Fatal Error in my WP “Call to undefined function get_option()”
- Issue using form in Google app in mobile
- No WP-Content Folder in Website Files, No Ability to Disable Plugins Manually
- Product image import
- Allowing users to install a predefined bundle of plugins and themes with one action
- Uncaught ArgumentCountError
- Secure way to add JS Script to WordPress filesystem
- Not applying update field (acf) in my plugin
- WP galleries in posts after import. How do I do it?
- How can I create a drawable image for a contact form
- My site has only one page, and users access my uploaded mp3 files from there – can I analyze access by song title?
- How to append TinyMCE editor in TinyMCE editor’s popup
- What plugin presents these extra columns in wp-admin -> plugins
- How to filter posts with a wp query by a custom dropdown type field with the magic fields plugin
- “All plugins are updated” but they aren’t
- How can I disable links for categories but keep showing them on my blog in an Elementor Template?
- Changing a class state in a wordpress plugin
- How to install and activate a plugin using an external PHP script?
- Can plugin authors make db tables remain upon deactivation, but be removed upon plugin deletion?
- View Version Details” on Plugin update shows “Plugin not found
- i have updated my wordpress to 6.3 and getting these errors. please help
- Custom page template from plugin does not work with pre-installed themes in WordPress 6.6.1
- Framework plugin inside wordpress
- How to access a function declared in child theme’s functions file in a plugin file?
- WordPress child theme widget customization – Eduma
- How to customize WP_Error (REST JWT authentication plugin) [closed]
- Which approach for managing automatic updates would be more robust?
- Custom Elementor controls not appearing in the widget Advanced tab using injection hooks