Yii Framework Forum: How To Interact From Db (Mysql) To Yii Framework ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Interact From Db (Mysql) To Yii Framework ? Rate Topic: -----

#1 User is offline   AustinGeek 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 22-September 12

Posted 01 May 2013 - 10:16 AM

Hey Guys

I am looking for a bit of wisdom.

I have a situation where an external html page will insert into a table in mysql db.

Basically the scenario is similar to registration. User enters info in form, capture in db, send email to verify,
User recieves email, clicks on link to verify, account is set active. User can then login.

I would rather do this as a Yii Form but the external website exists and can't be updated, there are also some politics involved.

So if the data is inserted into the table.

How do I best trigger the creation of an email to send to the user?

I can build the email in text or html format (would like to use a template), send it and setup a controller to validate the link
and redirect the user to a login. Just can't sort out the best way to trigger the event.

Options that I have thought of so far:
1. A cron job that runs every minute looking at the queue of registrants (1 minute is a big delay but I hate to have cron
kicking off that frequently)

2. Try to send the email from the POST when the db record is sent. I can do this but it makes it very difficult to sync with
the email verify as I have to build some sort of hash string, currently done in the db pre-insert trigger.

I found the hash at insert works fine but from the Yii controller the value is null in the after-save (insert) trigger
in the controller....but that is a whole different post.


As always thanks for any help! This is a great communitYii!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users