-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submissions via GraphQL is missing site context #1808
Comments
I actually think this is mostly broken alias resolution, not even doing |
So within the queue job itself that sends out the email notifications, we set the current site based on the site of the submission formie/src/jobs/SendNotification.php Lines 49 to 51 in d91b8d6
I would have thought that mean |
Just a quick test on my end, and they seem to be resolving correctly for me:
Just using a simple mutation: mutation saveSubmission {
save_contactForm_Submission(siteId:2) {
title
}
} I assume you have an Email Template setup, and your adding it to the Twig template, and not just the "Email Content" setting for the notification? |
I'm confused now, I'm trying something different for another site I'm developing, and I have an Entry field (drop down) in my form. I'm trying to create an email notification for it but I'm seeing similar odd behavior. This is not submitted via GraphQL, so the GraphQL might be a red herring. Firstly, I didn't have @web set for this site, so the link to the entry in the email became relative. Adding the @web alias, I get an absolut url at least, but the link also points to the admin page which is not my intention. But firstly, I don't actually use @web in the baseurl, I use a different alias that was indeed set, so seems like the link building doesn't actually work as intended. But I can't control how the email template links to the entry, unless I override the email template rendering of entry fields. Is the intention that it always links to the admin url of an entry? |
I will say elements linking to their admin So the What's your site settings look like? |
Describe the bug
I'm trying to adjust an email notifications for submissions that comes via GrahpQL.
For some reason, the linking context is off. the global
siteUrl
isn't set, and it seems like it doesn't understand under which site context it has been submitted. I tried adding siteId to the graphQL submission, but that doesn't make a difference.I'm trying to link to the public facing website for links and images, and I have an entry submission that also links wrong (or rather, some weird relative linking).
I'm not sure if I'm using it wrong or if it is a bug. The same variables are linking correctly on forms that are submitted normally (not via GraphQL).
Steps to reproduce
Form settings
Submission via GraphQL
Craft CMS version
4.8.0
Plugin version
2.1.5
Multi-site?
No
Additional context
No response
The text was updated successfully, but these errors were encountered: