Skip to content

Commit 2c29973

Browse files
committed
Improve API request email
* Enhance the email message content. * Streamline About content in web UI. * Format code and fix typos. Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 574fcd4 commit 2c29973

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

vulnerabilities/templates/navbar.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,24 @@
4444
<div class="dropdown-menu navbar-hover-div" role="menu">
4545
<div class="dropdown-content">
4646
<div class="dropdown-item about-hover-div">
47-
A free and open vulnerabilities database and the packages they impact.
48-
And the tools to aggregate and correlate these vulnerabilities.
47+
48+
VulnerableCode is a free and open database of software package vulnerabilities.
4949
<ul>
5050
<li>
51-
Sponsored by NLnet <a href="https://nlnet.nl/project/vulnerabilitydatabase/">
52-
https://nlnet.nl/project/vulnerabilitydatabase/</a> for
53-
<a href="https://www.aboutcode.org/">https://www.aboutcode.org/</a>
51+
Live chat at <a href="https://gitter.im/aboutcode-org/vulnerablecode">
52+
https://gitter.im/aboutcode-org/vulnerablecode</a>
5453
</li>
5554
<li>
56-
Chat at <a href="https://gitter.im/aboutcode-org/vulnerablecode">
57-
https://gitter.im/aboutcode-org/vulnerablecode</a>
55+
Source code and support at <a href="https://github.com/nexB/vulnerablecode">https://github.com/nexB/vulnerablecode</a>
5856
</li>
5957
<li>
6058
Docs at <a href=https://vulnerablecode.readthedocs.org/>
6159
https://vulnerablecode.readthedocs.org/</a>
6260
</li>
6361
<li>
64-
Source code and issues at <a href="https://github.com/nexB/vulnerablecode">https://github.com/nexB/vulnerablecode</a>
62+
Sponsored by NLnet <a href="https://nlnet.nl/project/vulnerabilitydatabase/">
63+
https://nlnet.nl/project/vulnerabilitydatabase/</a> for
64+
<a href="https://www.aboutcode.org/">https://www.aboutcode.org/</a>
6565
</li>
6666
</ul>
6767
</div>

vulnerabilities/views.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,33 @@ def get(self, request):
141141
return render(request=request, template_name=self.template_name, context=context)
142142

143143

144+
email_template = """
145+
Dear VulnerableCode.io user:
146+
147+
We have received a request to send a VulnerableCode.io API key to this email address.
148+
Here is your API key:
149+
150+
Token {auth_token}
151+
152+
If you did NOT request this API key, you can either ignore this email or contact us at [email protected] and let us know in the forward that you did not request an API key.
153+
154+
The API root is at https://public.vulnerablecode.io/api
155+
To learn more about using the VulnerableCode.io API, please refer to the live API documentation at https://public.vulnerablecode.io/api/docs
156+
To learn about VulnerableCode, refer to the general documentation at https://vulnerablecode.readthedocs.io
157+
158+
--
159+
Sincerely,
160+
The nexB support Team.
161+
162+
VulnerableCode is a free and open database of software package vulnerabilities
163+
and the tools to aggregate and correlate these vulnerabilities.
164+
165+
Chat at https://gitter.im/aboutcode-org/vulnerablecode
166+
Docs at https://vulnerablecode.readthedocs.org/
167+
Source code and issues at https://github.com/nexB/vulnerablecode
168+
"""
169+
170+
144171
class ApiUserCreateView(generic.CreateView):
145172
model = models.ApiUser
146173
form_class = ApiUserCreationForm
@@ -155,15 +182,15 @@ def form_valid(self, form):
155182
return redirect(self.get_success_url())
156183

157184
send_mail(
158-
subject="VulnerableCode.io API key token",
159-
message=f"Here is your VulnerableCode.io API key token: {self.object.auth_token}",
185+
subject="VulnerableCode.io API key request",
186+
message=email_template.format(auth_token=self.object.auth_token),
160187
from_email=env.str("FROM_EMAIL", default=""),
161188
recipient_list=[self.object.email],
162189
fail_silently=True,
163190
)
164191

165192
messages.success(
166-
self.request, f"API key token sent to your email address {self.object.email}."
193+
self.request, f"Your API key token has been sent to your email: {self.object.email}."
167194
)
168195

169196
return response

0 commit comments

Comments
 (0)