-
Notifications
You must be signed in to change notification settings - Fork 0
Final deploy #67
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
Merged
Merged
Final deploy #67
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,19 @@ | ||
| # Database Configuration | ||
| DB_URL=postgres | ||
| # Shared Database Configuration | ||
| DB_URL=localhost | ||
| DB_PORT=5432 | ||
| DB_NAME=authdb | ||
| DB_USER=resellio | ||
| DB_PASSWORD=localpassword | ||
| DB_NAME=resellio_db | ||
| DB_USER=root | ||
| DB_PASSWORD=my_password | ||
|
|
||
| # Auth Service JWT Configuration | ||
| SECRET_KEY=a-very-secret-key-for-local-development-change-me | ||
| # JWT & Security Configuration | ||
| SECRET_KEY=a-very-secure-secret-key-for-jwt-256-bit | ||
| ACCESS_TOKEN_EXPIRE_MINUTES=30 | ||
| ADMIN_SECRET_KEY=local-admin-secret-key | ||
| INITIAL_ADMIN_EMAIL=admin@resellio.com | ||
| INITIAL_ADMIN_PASSWORD=AdminPassword123! | ||
| ADMIN_SECRET_KEY=change-in-production | ||
|
|
||
| # SendGrid Email Configuration | ||
| EMAIL_API_KEY="api-key-placeholder" | ||
| EMAIL_FROM_EMAIL="sender-email-placeholder" | ||
| # Email (SendGrid) Configuration | ||
| EMAIL_API_KEY=YOUR_SENDGRID_API_KEY | ||
| # The email address that will appear in the "From" field | ||
| EMAIL_FROM_EMAIL=noreply@resellio.com | ||
| # The base URL of the application, used for constructing verification links | ||
| # For local testing, this points to the API Gateway | ||
| APP_BASE_URL=http://localhost:8080 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
|
|
||
| SENDGRID_API_KEY = os.getenv("EMAIL_API_KEY") | ||
| FROM_EMAIL = os.getenv("EMAIL_FROM_EMAIL", "tickets@resellio.com") | ||
| APP_BASE_URL = os.getenv("APP_BASE_URL", "http://localhost:8080") | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
@@ -52,23 +53,16 @@ def send_ticket_email( | |
| ): | ||
| """ | ||
| Send beautifully designed ticket confirmation email using SendGrid. | ||
|
|
||
| Args: | ||
| to_email: Recipient's email address | ||
| user_name: Recipient's name | ||
| event_name: Name of the event | ||
| ticket_id: Ticket ID | ||
| event_date: Event date (formatted string) | ||
| event_time: Event time (formatted string) | ||
| venue: Venue name | ||
| seat: Seat number/code | ||
|
|
||
| Returns: | ||
| bool: True if email was sent successfully, False otherwise | ||
| """ | ||
| if not SENDGRID_API_KEY: | ||
| logger.error("SendGrid API key not set - cannot send emails") | ||
| return False | ||
| if not APP_BASE_URL: | ||
| logger.error("APP_BASE_URL not set - cannot construct email links") | ||
| # Fallback to a generic domain if not set, but log an error | ||
| base_url = "http://resellio.com" | ||
| else: | ||
| base_url = APP_BASE_URL.replace('/api', '') # Ensure we have the root URL | ||
|
||
|
|
||
| # Generate QR code containing ticket info | ||
| qr_data = f"TICKET:{ticket_id}|EVENT:{event_name}|DATE:{event_date}|TIME:{event_time}|VENUE:{venue}|SEAT:{seat}" | ||
|
|
@@ -208,20 +202,18 @@ def send_ticket_email( | |
|
|
||
| <p>Please save this email and bring it with you to the event. You can also access your tickets anytime from your account.</p> | ||
|
|
||
| <p>We hope you enjoy the event!</p> | ||
|
|
||
| <div style="text-align: center;"> | ||
| <a href="https://resellio.com/my-tickets" class="button">View My Tickets</a> | ||
| <a href="{base_url}/home/customer" class="button">View My Tickets</a> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="footer"> | ||
| <p>© 2025 Resellio. All rights reserved.</p> | ||
| <p>This is an automated message. Please do not reply to this email.</p> | ||
| <p> | ||
| <a href="https://resellio.com/terms">Terms of Service</a> | | ||
| <a href="https://resellio.com/privacy">Privacy Policy</a> | | ||
| <a href="https://resellio.com/contact">Contact Us</a> | ||
| <a href="{base_url}/terms">Terms of Service</a> | | ||
| <a href="{base_url}/privacy">Privacy Policy</a> | | ||
| <a href="{base_url}/contact">Contact Us</a> | ||
| </p> | ||
| </div> | ||
| </body> | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
APP_BASE_URLhas a default non-empty value fromos.getenv, this branch will never execute. If you intend to detect a missing environment variable, retrieve the raw environment lookup first, then apply a default only after the check.